ql error :host '*.*.*.*' is not allowed to connect to mysql server

sql错误:不允许主机“*.*.*.*连接到mysql服务器。

解决:

  mysql -uroot -p;//键入密码进入你的数据库

  use mysql;

   select host,user,password from user where host='localhost' and user='root';//可以先查看一下如图

 

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

  执行 select host,user,password from user;可以看到已经改了

 

  flush privileges;//刷新一下权限,再次连接就可以了

 

 

 

 

posted @ 2019-11-14 15:27  请叫我靓仔  阅读(143)  评论(0编辑  收藏  举报