create connection SQLException, url: jdbc:mysql://localhost:3306/spring, errorCode 1045, state 28000
java.sql.SQLException: Access denied for user ‘sshdg’@‘localhost’ (using password: YES)
在这里插入图片描述
数据库1045错误,是密码或者用户名错误。
我这里的原因是发现,使用了spring,配置文件中的username不能叫username,spring会默认username是你的计算机名,解决办法,把username改个名字即可。
或在每个配置信息前面加上 jdbc. 即可(jdbc.username)。
参考博客:https://blog.csdn.net/coder_kang/article/details/104623005/

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐