最新消息:

Table 'mysql.servers' doesn't exist and not allowed to connect to MySQL server(转)

mysql 大步 939浏览 0评论

来源:http://hi.baidu.com/hovlj_1130/blog/item/a7fffc42f747d11873f05de6.html

今天在家安装wamp,安装完默认mysql root密码为空,修改密码flush privileges后,提示:

ERROR 1146 (42S02): Table 'mysql.servers' doesn't exist

 

解决方法为,建立mysql.servers表:

CREATE TABLE mysql.servers (

Server_name char(64) NOT NULL,

Host char(64) NOT NULL,

Db char(64) NOT NULL,

Username char(64) NOT NULL,

Password char(64) NOT NULL,

Port int(4) DEFAULT NULL,

Socket char(64) DEFAULT NULL,

Wrapper char(64) NOT NULL,

Owner char(64) NOT NULL,

PRIMARY KEY (Server_name)

) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL Foreign Servers table';

 

而后flush privileges;成功,然而在退出再登陆时提示:

ERROR 1130 (HY000): Host 'localhost' is not allowed to connect to this MySQL server

 

解决方法:

mysql.ini中加入

skip-grant-tables行,保存。

net stop wampmysqld

net start wampmysqld

 

mysql -u root登入后,修改

update mysql.user set password=password('123456') where user='root' and host='localhost';

flush privileges;

mysql.ini里的skip-grant-tables行去掉,OK,问题解决。

 

后面找到问题所在,在修改root密码时,粗心用的:

update mysql.user set password=md5('123456') where user='root' and host='localhost';

导致的无法登陆。


转载请注明:大步's Blog » Table 'mysql.servers' doesn't exist and not allowed to connect to MySQL server(转)

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
SiteMap