Navicat连接mysql时提示error:1130 host"xxx" is not allowed to connect to this SQL server

根据错误提示error:1130 host"xxx" is not allowed to connect to this SQL server,说明host不允许连接,那么就需要去对host进行设置。

操作如下:

1.在cmd 使用mysql -u root -p  #进入数据库

2.使用show databases;   #查看数据库,找到mysql

3.使用use mysql; #选择操作的数据库

4.show tables;  #查看表找到user表

5.desc user;  #查看表的属性

6.select host,user from user where user = "root";  #查看root 对应的host

7.update user set host="%" where user = "root";  #更新root 的 host属性

8.flush privileges;  #刷新数据库

参考博文:https://blog.csdn.net/weixin_44197207/article/details/86496678

发布了131 篇原创文章 · 获赞 211 · 访问量 27万+

猜你喜欢

转载自blog.csdn.net/qq_26870933/article/details/92794431