Cannot create backup: The mysqldump utility has returned '2'

Created:

2016-11-16 13:01:12 UTC

Modified:

2017-08-08 13:10:38 UTC

1

Was this article helpful?


Have more questions?

Submit a request

Cannot create backup: The mysqldump utility has returned '2'

Applicable to:

  • Plesk for Windows
  • Plesk for Linux

Symptoms

  • The migration finishes with the error message:
    Cannot dump database content 'database' of type 'mysql'

    Error:
    Cannot backup content of database 'database'. The mysqldump utility has returned '2'. STDERR: mysqldump: Got error: 1146: Table 'database.table' doesn't exist when using LOCK TABLES
  • The similar error messages can be found during backup creation:

    <description>Cannot dump database content 'database' of type 'mysql'</description>
    <message severity="error" code="BUException">
    <description>Cannot backup content of database 'database'. The mysqldump utility has returned '2'.
    STDERR: mysqldump: Got error: 1356: View 'database.table' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them when using LOCK TABLES
    Or:
    Warning: domain "example.com"
    Cannot dump database content 'database' of type 'mysql'[Cannot backup content of database 'database'. The mysqldump utility has returned '7'. STDERR: mysqldump: unknown variable 'defaults-extra-file=C:\Program Files (x86)\Parallels\Plesk\PrivateTemp\tmp26882.tmp' ]

    Or:

    Unable to execute SQL: View 'database' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them. SQL query: SHOW FULL COLUMNS IN `database`
  • Upon checking the integrity of the database and its tables by running the mysqlcheck utility, the following error occurs:

    Error: Table ‘database.table’ doesn’t exist
    status: Operation failed

Cause

The database is corrupted.

Resolution

  1. Try to repair the database:

    1.1. Go to Domains > example.com > Databases and click on Check and Repair .

    1.2. In the pop-up box click on See Details and Resolve > Repair Selected .

  2. In case of corrupted database structure, it might be needed to restore the corrupted database from a valid backup or delete table manually using DROP TABLE SQL statement.
Have more questions? Submit a request
Please sign in to leave a comment.