【Mac配置Mysql】Navicate无法连接数据库 通过navicat连接mysql服务器提示SQL Error (1130): Host '192.168.1.100' is not allowed to connect to this MySQL server

前端之家收集整理的这篇文章主要介绍了【Mac配置Mysql】Navicate无法连接数据库 通过navicat连接mysql服务器提示SQL Error (1130): Host '192.168.1.100' is not allowed to connect to this MySQL server前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

通过navicat连接mysql服务器提示SQL Error (1130): Host '192.168.1.100' is not allowed to connect to this MySQL server

新装一个MysqL,尝试用通过navicat连接MysqL服务器的时候提示:

 sql Error (1130): Host '192.168.1.100' is not allowed to connect to this MysqL server

说明所连接的用户帐号没有远程连接的权限,只能在本机(localhost)登录。需更改 MysqL 数据库里的 user表里的 host项把localhost改称%

首先按下面的步骤登录MysqL服务器

登录MysqL需要切换到dos下的MysqL的bin目录,进行如下操作:

MysqL>use MysqL;

MysqL>update user set host = '%'  where user ='root';

如果提示: ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY',请执行select user,host from user,看看是不是已经有host为%的root用户

,如果有直接执行下面步骤

MysqL>flush privileges;

(这句很重要,不能忘记)
MysqL>select 'host','user' from user where user='root';

MysqL>quit

OK。远程连接成功!

猜你在找的MySQL相关文章