• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue mysqldump error when trying to export a DB dump in Plesk

burnley

Regular Pleskian
CentOS Linux 7.8.2003 (Core) running Plesk Obsidian Version 18.0.29 Update #2
MariaDB 10.2.33

We have this database which can't be exported from Plesk because the configured db user doesn't (didn't?) have LOCK TABLES privileges. When I try to export it using the Export Dump link in the Databases page I get this error:

Unable to export a dump of db_name:
  • mysqldump: Got error: 1045: "Access denied for user 'db_user'@'localhost' (using password: YES)" when using LOCK TABLES
  • ("program 'mysqldump' finished with non-zero exit code: %d", 2)
I can replicate it in cli running mysqldump, *BUT* if I use "--single-transaction" option the command completes successfully. As in:

1. Failure:
# mysqldump -u db_user -p'password' -h localhost db_name >db_name.sql
mysqldump: Got error: 1045: "Access denied for user ''db_user@'localhost' (using password: YES)" when using LOCK TABLES

2. Success:
# mysqldump -u db_user -p'password' -h localhost --single-transaction db_name >db_name.sql
#

I then went into the mysql console running "plesk db" and executed:
MariaDB [psa]> GRANT SELECT, LOCK TABLES ON `db_name`.* TO 'db_user'@'localhost';

But it didn't make any difference, still getting the same error mentioning LOCK TABLES. How can I fix this?
And anther question: Is there any way to configure the mysqldump options list when it's executed from the Plesk panel? Thinking of using "--single-transaction", which is the recommended way to dump InnoDB tables in the recent MySQL / MariaDB version anyway.
 
But it didn't make any difference, still getting the same error mentioning LOCK TABLES. How can I fix this?
Looks like you forgot to run

flush privileges;

after your SQL query. Also SQL query:

GRANT SELECT ON mysql.proc to 'db_user';

may be required.
 
Tks @IgorG , in fact I did run FLUSH PRIVILEGES several times. I've also run the "GRANT SELECT ON mysql.proc to 'db_user'" you suggested, no luck yet. I'm really at a loss...
Is there a way to configure the mysqldump options for the Plesk panel?
 
Back
Top