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

2 comments

I’m not sure what caused this error in the first place, as it cropped on a server I don’t admin..

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

This cropped up on Server version: 5.1.36 MySQL Community Server (GPL) by Remi, installed on CentOS whenever I would execute the ‘FLUSH PRIVILEGES’ command.

The solution?  Try this.

USE mysql;
 
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';

Apparently this issue arises sometimes with an incomplete MySQL upgrade.  Beyond just installing new binaries you’ll often need to run scripts/mysql_fix_privilege_tables to ensure the ‘mysql’ database contains all the needed stuff.

July 10th, 2009 at 6:53 pm  

Posted in Databases

2 Responses to 'ERROR 1146 (42S02): Table ‘mysql.servers’ doesn’t exist'

Subscribe to comments with RSS or TrackBack to 'ERROR 1146 (42S02): Table ‘mysql.servers’ doesn’t exist'.

  1. Thanks dude… figured that this was the only way. You’re the best.

    enknot

    22 Sep 09 at 3:43 pm

  2. [...] solution could be the one explained here, but on my servers the before mentioned command worked [...]

Leave a Reply