学以致用

focus on Python , C++, and some interest in Go and R

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

使用远程连接mysql的时候碰到这样的错误:

Host is not allowed to connect to this MySQL server。

简单的解决方式如下:

(1)修改表。可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"

mysql -u root -p

按照提示输入密码

mysql>use mysql;

mysql>update user set host = '%' where user = 'root';

(2)修改完后执行如下SQL命令

flush privileges

posted on 2011-06-23 10:59  Jerry.Kwan  阅读(616)  评论(0编辑  收藏  举报