Mysql错误--Table 'mysql.servers' doesn't exist.

问题:
今天在初始化数据库的时候,在配置文件里加了"--skip grant tables",登陆进去之后,发现无法修改root密码,报这个错误。
 
Table 'mysql.servers' doesn't exist.

后来一查,这个表跟其他表也没啥关联,索性删了重建。

drop table if exists mysql.servers;
CREATE TABLE `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;

就可以恢复正常了~

上一篇:Spring mybatis 往mysql数据添加数据时报错:Cause: java.sql.SQLException: Field 'id' doesn't have


下一篇:Table 'jiang.hibernate_sequence' doesn't exist