Host is not allowed to connect to this MySQL server解决方法
docker exec -it mysql5.7 bash
mysql -uroot -p
- 执行
use mysql;
- 执行
update user set host = '%' where user = 'root';
这一句执行完可能会报错,不用管它。 -
执行
FLUSH PRIVILEGES;
docker exec -it mysql5.7 bash
mysql -uroot -p
use mysql;
update user set host = '%' where user = 'root';
这一句执行完可能会报错,不用管它。执行FLUSH PRIVILEGES;