Mysql ERROR 1130: Host "localhost" is not allowed
时间:2010-04-11 来源:shineboy816
当使用Mysql帐号远程登陆的时候,出现类似如下错误:
ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL
解决办法:
例如,你想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;
操作完毕后,记得重新启动mysql命令生效。
Windows下:net stop mysql / net start mysql
Linux下:service mysql restart 或 /etc/init.d/mysql restart
修改之后,就OK啦。
相关阅读 更多 +