Home  >  Article  >  Database  >  ERROR 1130:mysql 1130连接错误的有效解决方法_MySQL

ERROR 1130:mysql 1130连接错误的有效解决方法_MySQL

WBOY
WBOYOriginal
2016-06-01 13:38:49877browse

bitsCN.com


ERROR 1130:mysql 1130连接错误的有效解决方法

 

今天在用sqlyog连接非本地的Mysql服务器的数据库,居然无法连接很奇怪,报1130错误,

ERROR 1130: Host 192.168.3.100 is not allowed to connect to this MySQL server

猜想是无法给远程连接的用户权限问题。结果这样子操作mysql库,即可解决。特贴出来。。在本机登入mysql后,更改 “mysql” 数据库里的 “user” 表里的 “host” 项,从”localhost”改称'%'。。    

 

mysql -u root -p

mysql>use mysql;

mysql>select 'host' from user where user='root';

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

mysql>flush privileges;

mysql>select 'host'   from user where user='root';

 

第一句是以权限用户root登录

第二句:选择mysql库

第三句:查看mysql库中的user表的host值(即可进行连接访问的主机/IP名称)

第四句:修改host值(以通配符%的内容增加主机/IP地址),当然也可以直接增加IP地址

第五句:刷新MySQL的系统权限相关表

第六句:再重新查看user表时,有修改。。

记得Mysql服务需要重新启动(确保修改有效),否则可能修改的结果无法体现。
 

bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn