mysql配置远程连接方法之一(改表法)

1、问题:如果在远程连接报错:1130-host ... is not allowed to connect to this MySql server,可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"

2、解决方法:

  (1)update user set host = '%' where user = 'root';

  (2)报错:ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY' 

  (3)mysql> flush privileges; 直接运行,然后连接成功

posted @ 2016-10-19 10:20  Timothy_lai  阅读(1330)  评论(0编辑  收藏  举报