`
lucky_xingxing
  • 浏览: 118142 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

mysql只能localhost连接,解决不允许其他机器去访问

    博客分类:
  • java
阅读更多

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

登陆mysql 
首先 use mysql; 
按照别人提供的方式update的时候,出现错误。 
mysql> update user set host='%' where user = 'root'; 
ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY' 
然后查看了下数据库的host信息如下: 
mysql> select host from user where user = 'root'; 

+-------------+------+

| host        | user |

+-------------+------+

| %           | root |

| 127.0.0.1   | root |

| MicroLetter |      |

| MicroLetter | root |

| localhost   |      |

+-------------+------+

host已经有了%这个值,所以直接运行命令: 
mysql>flush privileges; 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics