Symptoms
Dump of a MySQL/MariaDB database hosted on the Plesk server fails:
mysqldump: Got error: 1146: Table '<TABLENAME>' doesn't exist when using LOCK TABLES
Backups have the following warning related to the database:
Unable to execute SQL: Table 'exampleDB.<TABLENAME>' doesn't exist in engine. SQL query: SHOW FULL COLUMNS IN `<TABLENAME>`
Migration fails with the following error:
Failed to copy content of database 'exampleDB'
Migration tools tried to perform operation in 3 attempts: Command execution failed on the source server 'source' (203.0.113.2) with non-zero exit code.
command: MYSQL_PWD="$(cat /etc/psa/.psa.shadow)" mysqldump --no-defaults -h localhost -P 3306 -uadmin --quick --quote-names --add-drop-table --default-character-set=utf8 --set-charset --routines --events exampleDB > /root/plesk_migrator/plesk_migrator-dy0onpkt6k9v4ydtwlfpf507xswuqmyh/db-dumps/exampleDB.sql
exit code: 2
stdout:
stderr: mysqldump: Got error: 1932: "Table 'exampleDB.table' doesn't exist in engine" when using LOCK TABLES
Cause
- InnoDB tablespace might have been deleted and recreated but corresponding
.frmfiles of InnoDB tables from the database directory were not removed, or.frmfiles were moved to another database - Incorrect permissions and ownership on table's files in MySQL/MariaDB data directory
- The table data has been corrupted
Resolution
Note: The steps below cover only most common use cases for Plesk on Linux installations. This is considered an administrative task that should be performed on your side.
Connect to the server via SSH
Try to…