Host ‘xx.xx.xx.xx‘ is not allowed to connect to this MySQL server解决方法

原因:mysql安装后未开放向外连接的权限

解决办法:

1.登录linux mysql

   命令:mysql -u root -p

2.切换到mysql模式

   命令:use mysql;

3.更新权限

  命令:update user set host = '%' where user = 'root'; 

4.刷新缓存

  命令:FLUSH PRIVILEGES;

 

 

posted @ 2023-03-28 09:05  榕先生  阅读(41)  评论(0)    收藏  举报  来源