赞
踩
java.sql.SQLException: Access denied for user ‘root’@‘localhost’ (using password: YES)错误原因 解决方案:
mysql
use mysql;
select * from user where user='你的用户名'\G;
authentication_string为5.7后mysql的密码字段
password原来的密码字段
然后更新:
update user set authentication_string=password('你的密码') where user='你的用户名';
3,第三种可能就是MYSQL的权限问题
GRANT
[权限]
ON [库.表]
TO [用户名]@[IP]
IDENTIFIED BY [密码]
# WITH GRANT OPTION;
示例:
GRANT
ALL PRIVILEGES
ON *.*
TO admin@'175.155.59.133'
IDENTIFIED BY 'admin';
每次更新权限后记得刷新权限
FLUSH PRIVILEGES;
权限问题具体参看这篇博文:
https://blog.csdn.net/weixin_42109012/article/details/102684153
4,数据库和驱动不匹配
https://blog.csdn.net/qq_41679818/article/details/105857793
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。