考虑:
./mysqladmin -u root -p** '_redacted_'
输出(包括输入密码):
Output (including typing the password):
输入密码:
mysqladmin: 在 'localhost' 连接到服务器失败错误:
'用户'root'@'localhost'的访问被拒绝(使用密码:YES)'
mysqladmin: connect to server at 'localhost' failed error:
'Access denied for user 'root'@'localhost' (using password: YES)'
我该如何解决这个问题?
How can I fix this?
/etc/my.cnf
或 /etc/mysql/my.cnf
,具体取决于您的发行版.[mysqld]
skip-grant-tables
mysql -u root -p
mysql>刷新权限;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword'设置新密码;
mysql -u root -p
/etc/my.cnf
or /etc/mysql/my.cnf
, depending on your distribution.skip-grant-tables
under [mysqld]
mysql -u root -p
mysql> flush privileges;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword';
mysql -u root -p
这篇关于MySQL 错误::“用户 'root'@'localhost' 的访问被拒绝"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!