(28000): Access denied for user 'root'@'localhost' (using password: YES)
时间: 2023-08-27 14:04:37 浏览: 106
这是MySQL数据库连接时的错误信息。根据引用,错误信息中的"Access denied for user 'root'@'localhost'"表示用户'root'在本地主机上被拒绝访问。而"(using password: YES)"表示在连接时使用了密码。
根据引用的建议,如果你在使用Navicat连接MySQL数据库时遇到2059错误,可以尝试登录MySQL并执行以下指令:先使用命令"use mysql;"切换到mysql数据库,然后执行"ALTER USER 'root'@'%' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;"和"ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password';",最后执行"FLUSH PRIVILEGES;"。
引用中提到,有些文章中提到可能是因为缺少库、表或时区问题导致的。作者试过了这些解决方法,但问题仍未解决。在调整了数据库的root权限和密码后,问题变成了"java.sql.SQLException: Access denied for user root @ localhost (using password: YES)"。
综上所述,出现"(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* [mysql登录报错:ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)](https://blog.csdn.net/m0_70556273/article/details/126490767)[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 style="max-width: 33.333333333333336%"]
- *2* [ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)](https://blog.csdn.net/LLL3189860667/article/details/126545183)[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 style="max-width: 33.333333333333336%"]
- *3* [java.sql.SQLException: Access denied for user root @ localhost (using password: YES) navicat 能连](https://blog.csdn.net/weixin_52901444/article/details/127828413)[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 style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文