读书人

mysql唯其如此localhost连接解决不允

发布时间: 2013-03-19 17:22:05 作者: rapoo

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

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;?

读书人网 >操作系统

热点推荐