create connection SQLException, url: jdbc:mysql://localhost:3306/spring, errorCode 1045, state 28000
java.sql.SQLException: Access denied for user ‘LYQ’@‘localhost’ (using password: YES)

数据库1045错误,是密码或者用户名错误。
使用了spring,配置文件中的username不能叫username,spring会默认username是你的计算机名,解决办法,把username改个名字即可。
或在每个配置信息前面加上 jdbc. 即可(jdbc.username)。

更多推荐