Unable to Export Database Dump: mysqldump: Got error: 1044

Created:

2016-11-16 13:15:18 UTC

Modified:

2017-08-08 13:13:13 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Unable to Export Database Dump: mysqldump: Got error: 1044

Applicable to:

  • Plesk 12.5 for Linux

Symptoms

Attempt to Export Dump of a database fails with the error:

Unable to export a dump of db_name:

Warning: Using unique option prefix database instead of databases is deprecated and will be removed in a future release. Please use the full name instead.
mysqldump: Got error: 1044: Access denied for user 'user_name'@'%' to database 'db_name' when using LOCK TABLES
Traceback (most recent call last):
File "/opt/psa/admin/sbin/dbbackup", line 6, in <module>
dbbackup.main()
File "/opt/psa/lib/modules/python/dbbackup/dbbackup.py", line 98, in main
backup(options, password)
File "/opt/psa/lib/modules/python/dbbackup/dbbackup.py", line 69, in backup
raise Exception("program 'mysqldump' finished with non-zero exit code: %d", p1.returncode)
Exception: ("program 'mysqldump' finished with non-zero exit code: %d", 2)

Cause

Missing LOCK TABLES privilege for database user.

Resolution

  1. Manually create mysql database backup .

  2. Access mysql database

    # plesk db
    mysql> use mysql
  3. Correct privileges for database user

    mysql> GRANT LOCK TABLES ON `db_name`.* TO 'user_name'@'%';
    Query OK, 0 rows affected (0.00 sec)

    mysql> flush privileges;
    Query OK, 0 rows affected (0.00 sec)
Have more questions? Submit a request
Please sign in to leave a comment.