使用c3p0连接mysql8.0以上问题

项目使用c3p0数据库连接池,之前都连接的mysql5.7左右版本,自己本地安装了mysql最新版本,连接时一直报错 
Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!
 
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could notacquire a resource from its primary factory or source.

想起之前自己写的demo项目连接本地mysql时需要换成mysql-connector-java-8.0.11.jar中的com.mysql.cj.jdbc.Driver新版驱动,更改maven配置


    mysql
    mysql-connector-java
    8.0.11

发现还是同样的报错。查找问题,c3p0的包也要更新


    
    
    com.mchange
    c3p0
    0.9.5.2

问题解决!

你可能感兴趣的:(坑)