远程连接Mysql服务器的数据库出现错误代码是1130,ERROR 1130: Host xxx.xxx.xxx.xxx is not allowed to connect to this
登录服务器mysql
登录服务器mysql
mysql -u root -p
输入密码进入mysql命令界面
1.use mysql;2.update user set host = '%' where user ='root';
3.update user set host = 'localhost' where user ='root' and host = '127.0.0.1';
4.flush privileges;
有的在执行第二步时可能会提示已经存在,忽略就行,继续执行第三步,然后输入
quit
再重启一下mysql
service mysql restart
就好了