Applicable to:
- Plesk for Linux
Symptoms
-
Dump of a MySQL/MariaDB database hosted on the Plesk server fails:
CONFIG_TEXT: mysqldump: Got error: 1146: Table '<TABLENAME>' doesn't exist when using LOCK TABLES
-
Backups have the following warning related to the database:
CONFIG_TEXT: Unable to execute SQL: Table 'database_name.<TABLENAME>' doesn't exist in engine. SQL query: SHOW FULL COLUMNS IN `<TABLENAME>`
Cause
The table data has been corrupted. The InnoDB engine cannot open the table for locking.
Resolution
- Connect to the server via SSH
-
Attempt to dump using
--skip-lock-tablesto workaround the lock requirement:# mysqldump --skip-lock-tables -u<db_user> -p<db_user_password> database_name > /root/database_dump.sql
Note: If this succeeds, the dump is complete. If not, continue below.
-
Attempt to repair the corrupted table using the native MySQL/MariaDB repair tool:
# plesk db
MYSQL_LIN: mysql> use database_name;
mysql> REPAIR TABLE <TABLENAME>;Note: Replace
<TABLENAME>with the table name shown in the error message. -
Retry the dump after the repair:
# mysqldump -u<db_user> -p<db_user_password> database_name > /root/database_dump.sql
Note: If the database is still not dumpable and there are no valid backups, use innodb_force_recovery as a last resort: How to fix InnoDB corruption cases for the MySQL database?
Comments
in my case the table is missing
Please sign in to leave a comment.