首页 > 数据库技术 > 详细

telnet mysql时出现:is not allowed to connect to this MySQL serverConnection closed by foreign host问题的解决

时间:2018-07-09 14:45:17      阅读:185      评论:0      收藏:0      [点我收藏+]

有时候telnet一个mysql服务器的时候会出现:

Host ‘192.168.0.1‘ is not allowed to connect to this MySQL serverConnection closed by foreign host.

如图:

技术分享图片

这个原因是因为索要链接的mysql数据库只允许其所在的服务器连接,需要在mysql服务器上设置一下允许的ip权限,如下:

连接命令端:

技术分享图片

1.连接mysql

mysql -u root -p

如图:

技术分享图片

2.授权

grant all privileges on *.* to ‘root‘@‘192.168.0.1‘ identified by ‘123456‘;

如图:

技术分享图片

当然,如果想给所有ip都赋予权限,则这样:

grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘123456‘;

3.使授权立即生效

flush privileges;

如图:

技术分享图片

然后再远程telnet或者连接这个mysql数据库就可以成功了。

 

参考

https://blog.csdn.net/dongdong9223/article/details/77854690

telnet mysql时出现:is not allowed to connect to this MySQL serverConnection closed by foreign host问题的解决

原文:https://www.cnblogs.com/imstrive/p/9283573.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!