1130 - Host ‘xxxx‘ is not allowed to connect to this MySQL server问题处理
问题描述
在使用Navicat连接数据库时,出现如下提示
1130 - Host 'xxxx' is not allowed to connect to this MySQL server
原因分析:
这个问题是因为在数据库服务器中的mysql数据库中的user的表中没有权限(也可以说没有用户),下面将记录我遇到问题的过程及解决的方法。
遇到这个问题首先到mysql所在的服务器上用连接进行处理
#
解决方案:
1、连接服务器: mysql -u root -p
2、看当前所有数据库:show databases;
3、进入mysql数据库:use mysql;
4、查看mysql数据库中所有的表:show tables;
5、查看user表中的数据:select host, user from user;
6、修改user表中的Host:update user set host='%' where user='root' and host='localhost';
7、最后刷新一下:flush privileges;
#一定要记得在写sql的时候要在语句完成后加上” ; “
再次连接成功
还没有评论,来说两句吧...