报错问题1130-host'192.168.2.137'is not allowed to connect to this mysql server

连接数据库服务器出现1130-host'192.168.2.137'is not allowed to connect to this mysql server错误,

这个问题是因为在数据库服务器中的mysql数据库中的user的表中没有记录权限

遇到这个问题首先到mysql所在的服务器上用连接进行处理

主要分为以下几步:

       1、连接mysql服务器

  2、看当前所有数据库:show databases;

  3、进入mysql数据库:use mysql;

  4、查看mysql数据库中所有的表:show tables;

  5、查看user表中的数据:select Host, User,Password from user;

  6、修改user表中的Host:update user set Host='%' where User='root';

  7、刷新授权列表:flush privileges;

       8:关闭防火墙:systemctl stop firewalld、iptables -F、 setenforce 0

#重新连接一下

猜你喜欢

转载自www.cnblogs.com/CMX_Shmily/p/11656541.html