imstrive

有时候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

分类:

技术点:

相关文章:

  • 2021-09-27
  • 2021-08-29
  • 2021-05-08
  • 2021-12-08
  • 2018-06-09
  • 2021-10-10
  • 2021-08-20
猜你喜欢
  • 2021-09-10
  • 2021-12-09
  • 2021-08-04
  • 2021-11-12
  • 2021-05-11
  • 2021-04-12
  • 2022-01-10
相关资源
相似解决方案