Score:1

mysqldump on mariadb 10.2.44 CentOS 7 does not work, but mysql does

nl flag

CentOS 7 MariaDB 10.2.44.

X [root@psa95 ~]$ rpm -qa | grep Maria
MariaDB-server-10.2.44-1.el7.centos.x86_64
MariaDB-common-10.2.44-1.el7.centos.x86_64
MariaDB-compat-10.2.44-1.el7.centos.x86_64
MariaDB-client-10.2.44-1.el7.centos.x86_64
✓ [root@psa95 ~]$ cat /etc/redhat-release 
CentOS Linux release 7.9.2009 (Core)

Credentials supplied in /root/.my.cnf with sections for client, mysqldump, mysql.

X [root@psa95 ~]$ mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4875
Server version: 10.2.44-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> Bye
✓ [root@psa95 ~]$ mysqldump mysql
mysqldump: Got error: 1045: "Access denied for user 'root'@'localhost' (using password: YES)" when trying to connect

The mysql command works. The mysqldump command doesn't.

I have tried using -p to prompt for the password, and supplying username and password on the commandline. Same thing -- works with mysql, does not work with mysqldump.

Another CentOS 7 system with exactly the same MariaDB version and the same setup in .my.cnf works perfectly. I have compared the mysqldump binary from both systems, they are identical.

I've scoured Google and tried every single idea I could find. None of it worked. What else can I try? What other information is needed to troubleshoot? I know the password is good -- it works with the mysql command.

ua flag
"mysqldump dump" dumps the database "mysql". Is there any issue dumping _your_ database?
nl flag
I can't dump ANY of the databases. I've tried them all. If I can get the auth to work, it will be root@localhost, which has no limitations. There must be some difference between the system that works and the one that doesn't that I haven't found yet which is critical for mysqldump to work. I can't make auth work with /root/.my.cnf or supplying credentials on the commandline. The mysql client command works perfectly, mysqldump doesn't. We have a sync script. An early step dumps databases on the source (excluding test and the *_schema databases) and imports them on the target system.
ua flag
When putting auth into `my.cnf`, be sure to put in the correct "sections", such as `[mysqld[`, `[mysqldump]`, `[client]`, etc..
nl flag
I had the same credentials in three sections: [mysql] , [mysqldump] , and [client]. Works perfectly on another system, but for this one and two others just like it, it's not working.
Score:0
nl flag

The problem turned out to be that mysqldump needed --ssl to function properly.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.