本文最后更新于 1198 天前,其中的信息可能已经有所发展或是发生改变。
ERROR 1130: Host ... is not allowed to connect to this MySQL server
说明所连接的用户帐号没有远程连接的权限,只能在本机(localhost)登录。 需更改 mysql 数据库里的 user表里的 host项
把localhost改称%
具体步骤:登陆到MySQL 首先 use mysql;
use mysql;
mysql> select host from user where user = 'root';
查看下数据库的host信息如下:
mysql> select host from user where user = 'root';
+------+
| host |
+------+
| % |
+------+
1 row in set (0.00 sec)
mysql> update user set host=‘%‘ where user = ‘root‘;
ERROR 1062 (23000): Duplicate entry ‘%-root‘ for key ‘PRIMARY‘
最后
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)