现在的位置: 首页 > 综合 > 正文

mysql“Access denied for user ‘root’@'IP地址’

2013年05月31日 ⁄ 综合 ⁄ 共 536字 ⁄ 字号 评论关闭

    xshell连接mysql毫无问题,使用toad登录时提示“Access denied for user
'root'@'10.1.6.130'
(using password: YES)”,搜到以下解决办法http://www.cnblogs.com/wonder315/archive/2011/11/02/2233010.html

    遂考虑使用

grant all privileges on *.* to 'root'@'%' with grant option;

    出于安全性考虑,不能采用所有的ip都放通,于是使用自己ip,同时限制死数据库

grant all privileges on calshard.* to 'root'@'10.1.6.130'  with grant option;

    实际上,后方的with grat option,应该根据实际情况填写,使用show grants看到的倒是的确会有这个后缀,直接执行会有如下错误:

ERROR 1133 (42000): Can't find any matching row in the user table

   改为

grant all privileges on calshard.* to 'root'@'10.1.6.130'  identified by 'xxx';

   搞定

 

抱歉!评论已关闭.