Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be a

转自:https://blog.csdn.net/qq_41304534/article/details/85760726
使用spring+mybatis+c3p0连接数据库报错:

Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be a_第1张图片
使用mysql 8.0.16出现以上报错,
这是因为mysql版本问题的原因,解决方法如下:

1.退回到5.x版本,其他配置不变

2.修改jdbc.properties文件

jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/AppStore?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true

你可能感兴趣的:(报错)