Host '' is not allowed to connect to this MySQL server

Host '192.168.4.21' is not allowed to connect to this MySQL server

远程服务器链接不允许。百度的方法都试了“改表法”、“授权法”,不管用。

我把我试的方法贴出来一下:

use mysql ;select user,host,password from user;
update user set host = '%' where user='root';
例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。 
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器,并使用mypassword作为密码 
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

以上试了都没用,help....

阅读 4.4k
1 个回答

还要在mysql的配置文件里把 bind 127.0.0.1给注视掉 然后重启mysql就好了

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题