远程测试mysql数据库3306端口报错

时间:2022-02-03 17:01:46

错误现象:
[root@localhost ~]# telnet 192.168.10.130 3306
Trying 192.168.10.130...
Connected to 192.168.10.130.
Escape character is '^]'.
GHost '192.168.10.120' is not allowed to connect to this MySQL serverConnection closed by foreign host
解决方法:
具体原因是权限问题,需要重新设置外部登陆用户权限
mysql> grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
Query OK, 0 rows affected (0.01 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit