项目换mysql8后,使用了新的jdbc和c3p0包。
idea中直接将相应的包添加到项目的lib文件夹并删除旧版本,
启动tomcat后类似如下错误:
[RMI TCP Connection(3)-127.0.0.1]2019-03-07 23:04:05,338 [ERROR] BaseExecutor:getDatabaseId:55 - Could not get a databaseId from dataSource
java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118)
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:77)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:690)
解决方案:
到tomcat的webapps目录下,删除整个应用项目后重新启动项目 正常