• 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
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

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