[main] ERROR com.alibaba.druid.pool.DruidDataSource - {dataSource-1} init error

主要报错:
[main] ERROR com.alibaba.druid.pool.DruidDataSource - {dataSource-1} init error
由于上述的错误,还会牵连出下面许多报错
Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: com.mysql.cj.jdbc.Driver
org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: com.mysql.cj.jdbc.Driver
………………
最终原因是mysql-connector-java的版本过低
在jdbc配置中写的是jdbc.driver=com.mysql.cj.jdbc.Driver新的写法,但导入的依赖过低
[main] ERROR com.alibaba.druid.pool.DruidDataSource - {dataSource-1} init error_第1张图片
要将版本换成8.0.11即可解决[main] ERROR com.alibaba.druid.pool.DruidDataSource - {dataSource-1} init error_第2张图片

你可能感兴趣的:(后端,java,mysql,intellij-idea)