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.