使用mysqladmin --defaults-file=/etc/mysql/debian.cnf
时,mysqladmin 失败并出现以下错误:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
但是,如果我尝试使用用户名和密码登录,例如:mysqladmin -uroot -pmysupersecretpass
它可以工作。
包含/etc/mysql/debian.cnf
[client]
host = localhost
user = root
password = mysupersecretpass
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = root
password = mysupersecretpass
socket = /var/run/mysqld/mysqld.sock
basedir = /usr
但是我也可以使用mysql -u root -p
.
谁能告诉我有什么问题/etc/mysql/debian.cnf
?