标签:
ERROR 1130: Host ***.***.***.*** is not allowed to connect to this MySQL server
说明所连接的用户帐号没有远程连接的权限,只能在本机(localhost)登录。 需更改 mysql 数据库里的 user表里的 host项
把localhost改称%
具体步骤:登陆到MySQL 首先 use mysql;
按照别人提供的方式update的时候,出现错误。
MySQL> update user set host=‘%‘ where user = ‘root‘;
ERROR 1062 (23000): Duplicate entry ‘%-root‘ for key ‘PRIMARY‘
然后查看了下数据库的host信息如下:
MySQL> select host from user where user = ‘root‘;
+-----------------------+
|host|
+-----------------------+
|% |
| 127.0.0.1 |
| localhost.localdomain |
+-----------------------+
3 rows in set (0.00 sec) host已经有了%这个值,所以直接运行命令:
再用 mysql -uroot -h***.***.***.***连接...成功!!
本文参考http://www.jb51.net/article/31902.htm
远程mysql出现ERROR 1130 (HY000): Host '172.17.42.1' is not allowed to connect to this MySQL server
标签:
原文地址:http://www.cnblogs.com/cuizhipeng/p/4386856.html