Symptoms
Applications like WordPress or Joomla cannot be installed. One of the following errors are shown:
PLESK_ERROR: Table ‘mysql.procs_priv’ doesn’t exist
PLESK_ERROR: Table ‘mysql.tables_priv’ doesn’t exist
PLESK_ERROR: Error: Connection to the database server failed: Cannot load from mysql.proxies_priv. The table is probably corrupted
Cause
MySQL tables corruption/misconfiguration.
Resolution
-
Connect to the server via SSH
-
Make sure that MySQL is upgraded by running:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin
-
Check MySQL database for errors:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqlcheck -uadmin mysql
-
If any table is corrupted, try to repair it using:
# plesk db
MYSQL_LIN: use mysql;
mysql> REPAIR TABLE <table_name>;
-
Try to install an application.
-
If the initial issue still persists, perform one of the following:
For the issue with `mysql.procs_priv` table, recreate it manually
# plesk db
MYSQL_LIN: use mysql;
mysql> CREATE TABLE `procs_priv` (
`Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT ”,
`Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT ”,
`User` char(16) COLLATE utf8_bin NOT NULL DEFAULT ”,
`Routine_name` char(64) CHARACTER SET utf8 NOT NULL DEFAULT ”,
`Routine_type` enum(‘FUNCTION’,’PROCEDURE’) COLLATE utf8_bin NOT NULL,
`Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT ”,
`Proc_priv` set(‘Execute’,’Alter Routine’,’Grant’) CHARACTER SET utf8 NOT NULL DEFAULT ”,
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`),
KEY `Grantor` (`Grantor`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT=’Procedure privileges’;mysql> CREATE TABLE `mysql`.`tables_priv` (
`Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT ”,
`Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT ”,
`User` char(16) COLLATE utf8_bin NOT NULL DEFAULT ”,
`Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT ”,
`Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT ”,
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Table_priv` set(‘Select’,’Insert’,’Update’,’Delete’,’Create’,’Drop’,’Grant’,’References’,’Index’,’Alter’,’Create View’,’Show view’,’Trigger’) CHARACTER SET utf8 NOT NULL DEFAULT ”,
`Column_priv` set(‘Select’,’Insert’,’Update’,’References’) CHARACTER SET utf8 NOT NULL DEFAULT ”,
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`),
KEY `Grantor` (`Grantor`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT=’Table privileges’;For the issue with `mysql.proxies_priv` table, update table schema
# plesk db
MYSQL_LIN: use mysql;
mysql> ALTER TABLE mysql.proxies_priv CHANGE User User char(16) NOT NULL;
mysql> ALTER TABLE mysql.proxies_priv CHANGE Proxied_user Proxied_user char(16) NOT NULL;
mysql> ALTER TABLE mysql.proxies_priv CHANGE Grantor Grantor char(77) NOT NULL;