Articles in this section

Migration or backup failed: mysqldump: Got error: 145

DoNotDelete:docref Plesk for Linux kb: technical ext: migrator ABT: Group A

Applicable to:

  • Plesk for Linux

Symptoms

  • Plesk full backup task got failed with   

    PLESK_ERROR: Failed to execute backup of mysql database

  • Manual backup of domain's database results in error:

    # plesk db dump db_name > database_backup.sql
    mysqldump: Got error: 145: Table './db_name/toc_whos_online' is marked as crashed and should be repaired when using LOCK TABLES

  • The following error appears during a migration process:

    PLESK_ERROR: WARNING: (mysql object 'db_name') Not all the data was backed up into /var/cache/<timestamp>/clients/ccia/domains/domain.tld/databases/db_name_1 successfully
    [....]
    mysqldump: Got error: 145: Table './db_name/Logs' is marked as crashed and should be repaired when using LOCK TABLES

    Or

    PLESK_ERROR: stderr: mysqldump: Got error: 144: "Table './db_name/table_name' is marked as crashed and last (automatic?) repair failed" when using LOCK TABLES

Cause

Database table corruption.

Resolution

Repair the corrupted database using one of the following methods:

Via Plesk GUI
  1. Log in to Plesk
  2. Navigage to Plesk > Domains > example.com > Databases > db_name and click Check and Repair:
    db-rep.PNG
Via phpMyAdmin
  1. Log in to Plesk;

  2. Navшgate to Plesk > Domains > example.com > Databases > db_name and click phpMyAdmin:
    db-rep.PNG

  3. Click SQL button and run the following query:

    CONFIG_TEXT: REPAIR TABLE table_name;

    Where table_name is the name of the table to repare

Via SSH
  1. Connect to the server via SSH;

  2. Execute the command:

    # MYSQL_PWD=cat /etc/psa/.psa.shadow  mysqlcheck -uadmin -r db_name table_name

    Where db_name is the name of the database where table table_name to be repaired.

Note: if the solutions below don't help, the affected database should be restored from a backup.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.