.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
时间: 2023-08-30 18:13:13 浏览: 96
这个错误是因为用户对应的密码不正确导致的。要解决这个问题,首先要检查输入的用户名和密码与数据库用户名和密码是否一致。常见的密码不正确的情况有两种:一是连接池多个空格,二是MySQL5.7后,MySQL系统表user里密码对应的字段不是password,而是authentication_string字段。如果遇到这个问题,可以使用以下命令来检查和解决:先输入命令 "mysql" 进入MySQL命令行,然后依次输入以下命令:use mysql; select * from user where user='你的用户名'\G; 在结果中找到对应的用户记录,确认authentication_string字段的值与你输入的密码是否一致。如果不一致,可以通过修改authentication_string字段的值来更正密码。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [解决java.sql.SQLException: Access denied for user ‘root‘@‘localhost‘ (using password: YES)](https://blog.csdn.net/qq_42248989/article/details/124198227)[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%"]
- *3* [java.sql.SQLException: Access denied for user ‘root’@‘localhost’ (using password: YES)错误原因](https://blog.csdn.net/qq_41357191/article/details/122338995)[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 ]
阅读全文