mysql -u root -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
时间: 2023-08-25 09:14:00 浏览: 94
这个错误报告是由于在登录mysql时输入的密码不正确导致的。根据引用和引用的信息,可以看出用户'root'@'localhost'登录失败且使用的密码是正确的。解决这个问题的方法是通过修改root用户的密码来解决。根据引用的信息,您可以使用以下命令来修改root用户的密码:
```
use mysql;
update user set authentication_string=password('新密码') where user='root';
flush privileges;
```
您需要将'新密码'替换为您想要设置的新密码。然后,再次使用`mysql -u root -p`命令进行登录,这次应该能够成功登录了。<em>1</em><em>2</em><em>3</em>
#### 引用[.reference_title]
- *1* [报错:Enter password: ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using ...](https://blog.csdn.net/robin_cai/article/details/119797084)[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^chatsearchT3_1"}} ] [.reference_item]
- *2* [mysql -u root -p报错:ERROR 1045 (28000): Access denied for user 'root'@'localhost'](https://blog.csdn.net/qq_40508832/article/details/84331411)[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^chatsearchT3_1"}} ] [.reference_item]
- *3* [解决mysql:ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO/YES...](https://blog.csdn.net/zhengkanzhuang6120/article/details/119868006)[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^chatsearchT3_1"}} ] [.reference_item]
[ .reference_list ]
阅读全文