HostwareSupport-Linux Hosting technical support for cPanel, Plesk, Directadmin servers

Linux Hosting technical support for cPanel, Plesk, Directadmin and No control panel servers offers and listing
http://hostwaresupport.com/

Sep 18, 2011

Table mysql.servers doesn’t exist: Problem adding a database user in plesk Or restarting mysql

You may receive a “Table ‘mysql.servers’ doesn’t exist” error message while adding a database user in Plesk OR while restarting the Mysql service. The complete error message look like:

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

OR

Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist

The problem mostly occurs when Mysql server is upgraded from an older to a newer version and the upgrade remains incomplete. Since Mysql often introduces new tables with the newer versions, you need to run the “mysql_fix_privilege_tables” script located in the “/usr/bin/” directory so the mysql database is updated with the latest contents thus fixing the privileges of the database users as well.

To fix the issue, ssh to your server as root and execute the command:

On a plain Linux OR Linux/cPanel server:

# mysql_fix_privilege_tables --user=root --password= --verbose

On a Linux/Plesk server:

# mysql_fix_privilege_tables --user=admin --password=`cat /etc/psa/.psa.shadow` --verbose

BTW, on a Linux/Plesk server, you may see the following error message sometimes:

Got a failure from command:
cat /usr/share/mysql/mysql_fix_privilege_tables.sql | /usr/bin/mysql –no-defaults –force –user=root –host=localhost –database=mysql
If you get an ‘Access denied’ error, you should run this script again and
give the MySQL root user password as an argument with the –password= option

In such a situation, use user/password argument with privilege command as follows:

# mysql_fix_privilege_tables --user=admin --password=`cat /etc/psa/.psa.shadow`  --verbose

where, –verbose will display the detailed output.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------


7

No comments:

Post a Comment