`

mysql报错处理: could not be resolved: getnameinfo() returned error (code: -3)

阅读更多

[文章作者:狂奔的鹿 本文版本:v1.0  转载请注明原文链接:http://dynamiclu.iteye.com/]

 

近期, 用mysqld_multi开了几个mysql实例,mysql版本5.5.8; 

然后授权:

GRANT ALL PRIVILEGES ON *.* TO 'lsl'@192.168.0.1 IDENTIFIED BY 'lusonglin' WITH GRANT OPTION;

 

客户端连接报错

could not be resolved: getnameinfo() returned error (code: -3).

如下图:

google里baidu了很久,没找到相关的中文解释原因。

在老外的坛子里发现如下方式:

Try the followng in that order to resolve:

1> At the console of the box on which mysql server is running type mysql -uroot -p
2> It will prompt you for root pasword is it was set. Once insidew mysql command shell type
user mysql;
3> now type the following command:
grant all privileges on *.* to '<username>'@'<IP>' identified by '<password>';
In above command replace <username> with the username you want for connection.<IP> with the IP of the host from where you want the permission to connect to this mysql server(in you case this shall be 192.168.1.2) You can also use 192.168.% to allow connection from all IP that begin eith 192.168. Similarly replacing <IP> with just % will allow connection from all hosts for this username. Replace <password> with the password you want.
4> type this command:
flush privileges;

大概意思是也要授权192.168.%   操作:

 

GRANT ALL PRIVILEGES ON *.* TO 'lsl'@'192.168.%' IDENTIFIED BY 'lusonglin' WITH GRANT OPTION;

 

 

客户端再连一下,果真OK了。

 

 注:配置文件上需加skip-name-resolve参数,不然也会出现同样错误

 

[文章作者:狂奔的鹿 本文版本:v1.0  转载请注明原文链接:http://dynamiclu.iteye.com/]

  • 大小: 35.7 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics