启动mysql-8.0.34-winx64报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
时间: 2023-09-30 17:11:08 浏览: 153
出现ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)错误通常是因为MySQL用户'root'@'localhost'的密码不正确导致的。解决方法如下:
1. 首先,确认你输入的密码是正确的。确保大小写和特殊字符都正确输入。
2. 如果你确信密码是正确的,那么你可以尝试使用以下命令更改'root'@'localhost'的密码:
```
mysql -u root -p
```
在提示输入密码的时候,重置密码为空:
```
ALTER USER 'root'@'localhost' IDENTIFIED BY '';
```
然后退出MySQL命令行。
3. 接下来,再次使用以下命令登录MySQL,并设置新的密码:
```
mysql -u root -p
```
在提示输入密码的时候,直接回车,然后执行以下命令:
```
ALTER USER 'root'@'localhost' IDENTIFIED BY '你的新密码';
```
请将'你的新密码'替换为你想要设置的新密码。
4. 完成了上述步骤后,再次退出MySQL命令行并重新启动MySQL服务。
通过执行以上步骤,你应该能够解决ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)错误,并成功启动MySQL。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)解决方法](https://blog.csdn.net/Fatelzg/article/details/120207664)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)解决办法--...](https://blog.csdn.net/weixin_45740811/article/details/126240243)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文