Webhosting Blog

Table ‘mysql.servers’ doesn’t exist


I was dealing with an error while adding a database user for a database using plesk. Note the error received:

Error: Connection to the database server has failed:
Table ‘mysql.servers’ doesn’t exist

For eliminating the error you can follow following steps:

1) Login to the server as root.

2)Issue following command:

[root@server ~]# mysql_fix_privilege_tables --user=admin --password=<admin passord> --verbose

This script updates all the mysql privilege tables to be usable by
the current version of MySQL

ERROR 1060 (42S21) at line 102: Duplicate column name 'File_priv'
ERROR 1060 (42S21) at line 108: Duplicate column name 'Grant_priv'
ERROR 1060 (42S21) at line 109: Duplicate column name 'Grant_priv'
ERROR 1060 (42S21) at line 110: Duplicate column name 'Grant_priv'
ERROR 1060 (42S21) at line 121: Duplicate column name 'ssl_type'
ERROR 1061 (42000) at line 131: Duplicate key name 'Grantor'
ERROR 1054 (42S22) at line 158: Unknown column 'Type' in 'columns_priv'
ERROR 1060 (42S21) at line 180: Duplicate column name 'type'
ERROR 1060 (42S21) at line 190: Duplicate column name 'Show_db_priv'
ERROR 1060 (42S21) at line 207: Duplicate column name 'max_questions'
ERROR 1060 (42S21) at line 217: Duplicate column name 'Create_tmp_table_priv'
ERROR 1060 (42S21) at line 220: Duplicate column name 'Create_tmp_table_priv'
ERROR 1060 (42S21) at line 345: Duplicate column name 'Create_view_priv'
ERROR 1060 (42S21) at line 348: Duplicate column name 'Create_view_priv'
ERROR 1060 (42S21) at line 351: Duplicate column name 'Create_view_priv'
ERROR 1060 (42S21) at line 357: Duplicate column name 'Show_view_priv'
ERROR 1060 (42S21) at line 360: Duplicate column name 'Show_view_priv'
ERROR 1060 (42S21) at line 363: Duplicate column name 'Show_view_priv'
ERROR 1060 (42S21) at line 380: Duplicate column name 'Create_routine_priv'
ERROR 1060 (42S21) at line 383: Duplicate column name 'Create_routine_priv'
ERROR 1060 (42S21) at line 386: Duplicate column name 'Create_routine_priv'
ERROR 1060 (42S21) at line 392: Duplicate column name 'Alter_routine_priv'
ERROR 1060 (42S21) at line 395: Duplicate column name 'Alter_routine_priv'
ERROR 1060 (42S21) at line 398: Duplicate column name 'Alter_routine_priv'
ERROR 1060 (42S21) at line 401: Duplicate column name 'Execute_priv'
ERROR 1060 (42S21) at line 404: Duplicate column name 'Execute_priv'
ERROR 1060 (42S21) at line 417: Duplicate column name 'max_user_connections'
ERROR 1060 (42S21) at line 426: Duplicate column name 'Create_user_priv'
ERROR 1060 (42S21) at line 448: Duplicate column name 'Routine_type'
ERROR 1054 (42S22) at line 573: Unknown column 'Event_priv' in 'where clause'
ERROR 1060 (42S21) at line 589: Duplicate column name 'sql_mode'
ERROR 1060 (42S21) at line 628: Duplicate column name 'originator'
ERROR 1060 (42S21) at line 632: Duplicate column name 'time_zone'
ERROR 1060 (42S21) at line 635: Duplicate column name 'character_set_client'
ERROR 1060 (42S21) at line 641: Duplicate column name 'collation_connection'
ERROR 1060 (42S21) at line 647: Duplicate column name 'db_collation'
ERROR 1060 (42S21) at line 653: Duplicate column name 'body_utf8'
ERROR 1054 (42S22) at line 663: Unknown column 'Trigger_priv' in 'where clause'
done

That’s it! Now try adding the user to the database. You should now be able to add the user without any error now. This error generally occurs while compiling Mysql to new version, apparently due to incomplete Mysql upgrade. You often need to run mysql_fix_privilige_tables command to ensure that the mysql database contains all the required contents.

FfRBehWy
Advertisements

26 responses

  1. Nick

    Awesome, I was worried for a second there after upgrading from Plesk 8.6 to 9.3.2 and seeing this but that’s sorted me right out. Cheers for posting it!

    August 2, 2010 at 4:30 pm

    • Thanks Nick! Glad to know your issue was resolved!!

      August 3, 2010 at 5:34 am

  2. yes its working fine for me… its really good one single command and solve the problem

    August 9, 2010 at 12:14 pm

    • Thanks for the comments Gunjan.

      August 9, 2010 at 2:35 pm

  3. Tushar P Ambekar

    Great Fix!!!!

    Kind Regards

    August 21, 2010 at 4:52 am

  4. Pingback: Blogs » Table ‘mysql.servers’ doesn’t exist

  5. Thanks for posting the fix!

    November 9, 2010 at 11:01 pm

  6. Pingback: 2010 in review « Linux Blog

  7. Thank you verry much for this fix, if been searching a long time for this :-)

    From holland THANK YOU o_o

    January 3, 2011 at 12:41 pm

    • Welcome.Glad to know your issue could be sorted with the mentioned fix. :-)

      January 5, 2011 at 5:58 am

  8. gus

    thankyouverymuch.

    January 15, 2011 at 11:23 pm

  9. Nasir

    Thanks Man… you have same by day…

    Tha

    Nasir

    February 5, 2011 at 4:30 am

  10. Mike Bailey

    Worked a treat great post :)!

    May 25, 2011 at 8:13 am

  11. Amazing!! Saved me a massive amount of time and potentially money as i was close to calling in a tech to come do this for me! Youre a star!

    August 1, 2011 at 1:50 pm

    • Hi Ollie,
      Glad to know you finally sorted it out! :)

      August 2, 2011 at 3:01 am

  12. You just saved my life with this post, thanks tons -zaddick

    August 5, 2011 at 11:54 am

  13. Wow, thanks — you saved my day.

    August 8, 2011 at 9:40 pm

  14. just as the others have said! thanks a lot ;)

    August 13, 2011 at 4:47 pm

  15. Awesome man, this did it, thanks!

    September 20, 2011 at 10:44 am

  16. mysql_fix_privilege_tables: command not found (((

    November 10, 2011 at 1:07 am

    • Check the mysql version on the server. This feature is available in mysql versions MySql 5 and onwards.

      November 16, 2011 at 2:25 pm

  17. Nice! Saved the day!

    December 13, 2011 at 7:46 pm

  18. kelogs

    I wish it had saved my day too. Mysql 5.5 here,

    [root@XMPP ~]# find / -iname mysql_fix_privilege_tables

    yelded no results

    April 3, 2012 at 10:02 pm

  19. It works for version 5.1 thanks

    August 7, 2012 at 8:59 am

  20. silo

    hi which user name of admin have i to give it doesnt work and which pass

    December 13, 2012 at 11:41 pm

    • Hi Silo,
      I apologize for the delayed reply.
      In a plesk server the admin user is the default and the main administrative user of the server. Please use the user as admin and the password will pertain to the password used by the admin user on the server. This should sort the issue.

      December 22, 2012 at 9:20 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s