失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > 远程mysql出现ERROR 1130 (HY000): Host '172.17.42.1' is not allowed to connect to this MySQL server...

远程mysql出现ERROR 1130 (HY000): Host '172.17.42.1' is not allowed to connect to this MySQL server...

时间:2021-01-03 00:18:34

相关推荐

远程mysql出现ERROR 1130 (HY000): Host '172.17.42.1' is not allowed to connect to this MySQL server...

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>flush privileges;

再用mysql -uroot -h***.***.***.***连接...成功!!

本文参考/article/31902.htm

如果觉得《远程mysql出现ERROR 1130 (HY000): Host '172.17.42.1' is not allowed to connect to this MySQL server...》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。