MySQL远程连接报错 ERROR 1130

来源:互联网 发布:c语言设置线程优先级 编辑:程序博客网 时间:2024/05/21 15:03

转自: dodott

新的一台服务器,刚装完MySQL,在本地用SQLyog账号连接出现错误。ERROR 1130: Host  112.74.183.37 is not allowed to connect to this MySQL server 

说明所连接的用户帐号没有远程连接的权限,只能在本机(localhost)登录。

登到mysql服务, 更改 “mysql” 库里的 “user” 表里的 “host” 字段,从”localhost”改称'%'
mysql -u root 
mysql>use mysql;
mysql>select `host` from user where user='root';

查询结果:

| host                    |
+-------------------------+
| 127.0.0.1               |
| izwz92o440hd7lxj6oc9v6z |
| localhost |


mysql>update user set host = '%' where user ='root' and host='localhost';
mysql>flush privileges;

重新尝试连接,问题解决。

阅读全文
0 0
原创粉丝点击