Is not allowed to connect to this mysql server问题解决

is not allowed to connect to this mysql server问题

问题主要反映的是访问当前MySQL,有些Ip的权限不够导致。

解决途径:

  • 登录MySQL
mysql -u root -p xxx
  • 进入系统mysql的database
use mysql;
  • 查看root账户对应的地址范围
select host from user where user = 'root';
  • 修改地址范围为全部(可以根据自己的需要修改地址范围)
update user set host = '%' where user = 'root';
  • 重启MySQL服务
# 由于是docker 部署
docker restart xxx(容器ID)

问题解决!

posted @ 2022-02-28 11:42  x1aoda1  阅读(160)  评论(0编辑  收藏  举报