is not allowed to connect tothis mmysql server

发现在linux中配置完mysql

开放完端口出现这个问题  

首先在linux中登录MySQL

然后输入  use mysql;

mysql> select host from user where user='root';

输入以上两个命令查看主机配置信息

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

将host设置为通配符模式%    Host设置“%”便可远程访问了

最后执行  flush privileges;  是更改的配置立即生效

 

猜你喜欢

转载自www.cnblogs.com/companionspace/p/10316083.html