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/]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值