用IP访问Mysql数据库时提示:
SQL Error (1130): Host '192.168.1.100' is not allowed to connect to this MySQL server
说明所连接的用户帐号没有远程连接的权限,只能在本机(localhost)登录。
解决方法:
1、需更改Mysql数据库里的 user表里的 host项:把localhost改称%。
2、按下面的步骤操作Mysql服务器:
(1)切换到dos下的mysql的bin目录
(2)mysql>mysql -u(用户名) -p(密码)
(3)mysql>use mysql;
(4)mysql>update user set host = '%' where user ='root';
(5)mysql>flush privileges;
(6)mysql>select 'host','user' from user where user='root';
(7)mysql>quit
大功告成!