'用户'root'@'localhost'的访问被拒绝(使用密码:NO)'

#39;Access denied for user #39;root#39;@#39;localhost#39; (using password: NO)#39;(用户root@localhost的访问被拒绝(使用密码:NO))

本文介绍了'用户'root'@'localhost'的访问被拒绝(使用密码:NO)'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置用户 root 的密码,但出现以下错误,知道吗?

I'm trying to set the password of the user root but I'm gettin the error below, any idea?

+----------------------------------------------------------------------------------------------------------------------------------------+
| Grants for root@localhost                                                                                                              |
+----------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*436576511F70A4E3B305E1AB8E209851945D8687' WITH GRANT OPTION |
+----------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)


mysql> exit
Bye
root@tirengarfio:/var/www/rs2# mysqladmin -u root password foo,
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

推荐答案

$ mysqladmin -u root -p password
Enter password: 
New password: 
Confirm new password:

password 应按字面输入.这是一个命令.您不必将 password 替换为您的实际密码.

password is to be typed literally. It's a command. You don't have to substitute password with your actual password.

这篇关于'用户'root'@'localhost'的访问被拒绝(使用密码:NO)'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:'用户'root'@'localhost'的访问被拒绝(使用密码:NO)'

基础教程推荐