环境运维

1130 - Host '_gateway' is not allowed to connect to this MySQL server 为解决

1130 - Host '_gateway' is not allowed to connect to this MySQL server

防火墙设置了阻止所有传入的

 

1.首先进入mysql容器(mysql是我的容器名)你们使用docker ps 查看自己的容器名

docker ps 

2.之后进入容器内部

docker exec -it mysql /bin/bash

3.登录进mysql

mysql -uroot -p(你自己的密码)

4.使用以下命令查看root用户的host是不是等于localhost

select host from user where user='root';

5.如果是继续往下走把localhost改为%也就是把只允许本地连接改为允许全部连接

update user set host = '%' where user ='root';

6.最后在刷新一下用户权限表就OK了

flush privileges;

————————————————
版权声明:本文为CSDN博主「虞泽」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_41940721/article/details/110480837