Enter current password for root (enter for none): ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
时间: 2023-08-27 20:17:10 浏览: 136
引用和中提到的错误"ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO/YES)"表示在使用root登录MySQL时,访问被拒绝。这个错误通常是由于密码问题导致的。在中提到的解决方法是在终端中使用mysql -u root -p命令登录MySQL,当需要输入密码时,直接按enter键即可不输入密码登录。然后,使用命令update user set password=password("你的新密码") where user="root";修改root用户的密码,再使用flush privileges;命令刷新权限,最后使用quit退出MySQL。
所以,如果你遇到了"Enter current password for root (enter for none): ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)"的错误,你可以尝试按照上述步骤进行操作,修改root用户的密码来解决这个问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [linux中ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)](https://blog.csdn.net/li2327234939/article/details/54289904)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [linux中的mysql数据库不能初始化,已解决](https://blog.csdn.net/qq_41342692/article/details/107458221)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [重置密码遇到ERROR 1045 (28000): Access denied for user root@localhost (using passwor:yes)问题](https://blog.csdn.net/qq_36564503/article/details/106991196)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文