mariadb 10.2.44 CentOS 7 上的 mysqldump 不起作用,但 mysql 可以

mariadb 10.2.44 CentOS 7 上的 mysqldump 不起作用,但 mysql 可以

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)

/root/.my.cnf 中提供的憑證包含客戶端、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

mysql 指令有效。 mysqldump 指令沒有。

我嘗試使用 -p 提示輸入密碼,並在命令列上提供使用者名稱和密碼。同樣的事情——適用於 mysql,不適用於 mysqldump。

另一個 CentOS 7 系統具有完全相同的 MariaDB 版本和 .my.cnf 中的相同設置,可以完美運作。我比較了兩個系統的 mysqldump 二進位文件,它們是相同的。

我搜尋了谷歌並嘗試了我能找到的每一個想法。這些都不起作用。我還能嘗試什麼?排除故障還需要哪些資訊?我知道密碼很好——它可以與 mysql 命令一起使用。

答案1

問題原來是 mysqldump 需要 --ssl 才能正常運作。

相關內容