Mysql连接报错:1130-host ... is not allowed to connect to this MySql server如何处理

1、登录数据库:mysql -u root -p

2、查看当前所有数据库:show databases;  并进入mysql数据库

3、查看mysql数据库中所有的表:show tables;  并查看user表中的数据:select host, user from user;

4、删除多余主机:delete from user where host = '127.0.0.1' or host = '::1';  修改user表中的host:update user set host='%' where user='root';

 

5、最后刷新一下:flush privileges;

猜你喜欢

转载自www.cnblogs.com/HwyStudy/p/9786019.html