现在的位置: 首页数据库>正文
mysql远程毗连:ERROR 1130 (HY000): Host *.*.*.*; is not allowed to connect to this MySQL server解决法子
发表于136 天前 数据库 暂无评论

录制项目顶用到了mysql,今天在测试时发现无法远程毗连mysql数据库,原本是mysql默认不许可远程毗连。

搜索了一下,找到体味决法子,记其实此以备日后查用。  

(1)一路头我利用root用户和mysql处事器ip远程毗连,直接报错:

[root@chu Record]# mysql --host=192.168.110.68 --user=root --password
Enter password:
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.110.68' (111)

 原本是

默认情况下Mysql只许可当地登录,所以需要点窜设置装备摆设文件将地址绑定给注释失踪:

vim /etc/mysql/my.cnf

# Instead of skip-networking the default is now to listen only on

# localhost which is more compatible and is not less secure.

#bind-address = 127.0.0.1 <—注释失踪这一行就可以远程登录了 

参见:http://blog.sina.com.cn/s/blog_60fcb5a10100qkyb.html

(2)点窜后继续报错: 

1  [root@chu Record]# mysql --host=192.168.110.68 --user=root --password
2 Enter password:
3 ERROR 1130 (HY000): Host '192.168.56.123' is not allowed to connect to this MySQL server

若是你想许可用户myuser从ip为192.168.1.3的主机毗连到mysql处事器,并利用mypassword作为密码

GRANT ALL PRIVILEGES ON *.* TO ‘myuser’@’192.168.1.3′ IDENTIFIED BY ‘mypassword’ WITH GRANT OPTION; 

参见:http://blog.csdn.net/rongjch/archive/2006/02/23/607124.aspx

这样操作后,问题解决了。 

给我留言


/ 快捷键:Ctrl+Enter
不想听你唠叨×