再使用druid链接吃的时候,有可能登录出现这个问题导致登不进去,而且控制台一直出现
ERROR [Druid-ConnectionPool-Create-23196847] [c.a.d.p.DruidDataSource]:2471 - create connection SQLException, url: jdbc:mysql://localhost:3306/oabangong?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true, errorCode 1045, state 28000
java.sql.SQLException: Access denied for user '86158'@'localhost' (using password: YES)
可能的原因
xx.properties的 key 写法有问题
解决方案
在你的 xx.properties 中的key前面加上 jdbc.
修改后
jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/oa?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
jdbc.username=root
jdbc.password=1234567
还有一件事:mysql 8版本的要加上 cj com.mysql.cj.jdbc.Driver