关于c3p0连接mysql8.0.11 配置文件 url 错误问题
报错条目为
关于 数据库连接 An attempt by a client to checkout a Connection has timed out 问题解决
下列参数注意更改“数据库名称”
由于是mysql8.0版本 需要重新更改url地址,即把useSSL=false&serverTimezone=UTC或者serverTimezone=GMT改成useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true就可以解决了
<?xml version='1.0' encoding='UTF-8'?>
<c3p0-config>
<!-- 使用默认的配置读取连接池对象 -->
<default-config>
<!-- 连接参数 -->
<property name="driverClass">com.mysql.cj.jdbc.Driver</property>
<property name="jdbcUrl">jdbc:mysql://localhost:3306/'数据库名称'?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true</property>
<property name="user">root</property>
<property name="password">root</property>
<!-- 连接池参数 -->
<property name="initialPoolSize">5</property>
<property name="maxPoolSize">60</property>
<property name="checkoutTimeout">2000</property>
<property name="maxIdleTime">1000</property>
</default-config>
</c3p0-config>