Reese Knowledgebase

Attempts to reset admin password result in 'ERROR 1146 (42S02) at line 2: Table 'mysql.servers' doesn't exist'

View Kristian Reese's profile on LinkedIn


If you like this article, please +1 or Recommend via FB with the provided buttons above:

Article ID: 75
by: Reese K.
Posted: 08 Nov, 2012
Last updated: 08 Nov, 2012
Views: 1055

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

While attempting to reset the admin password, the above error occurs.

Solution 1:

~# /usr/bin/mysql_fix_privilege_tables --user=admin --database=mysql --password=`cat /etc/psa/.psa.shadow`

Solution 2:

Recreate the mysql.servers table:

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

 

Or download the sql file and import it:

mysql -u admin -p`cat /etc/psa/.psa.shadow` mysql < mysql.servers.sql

This article was:   Helpful | Not Helpful
Prev   Next
No such file or directory error during vzmigrate     How to find dead links and delete them

RSS