在进行DBCP没有错误而在尝试c3p0链接mysql的时候总是出现这几个问题,之前一直以为是版本的问题就把
mysql的版本和驱动版本都更新到最新,可是还是一样的错误,然后又调大的xml的配置可还是同样的问题
警告: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@605b17a1 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:
java.sql.SQLException: Unknown system variable 'query_cache_size'
....
警告: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@48140564 is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
java.sql.SQLException: Connections could not be acquired from the underlying database!
...
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
...
Caused by: java.sql.SQLException: Unknown system variable 'query_cache_size'
...
警告: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@48140564 is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
配置信息:
<default-config>
<!-- 基本配置 -->
<property name="driverClass">com.mysql.cj.jdbc.Driver</property>
<property name="jdbcUrl">jdbc:mysql://127.0.0.1:3306/day07?useSSL=false&serverTimezone=UTC</property>
<property name="user">root</property>
<property name="password">123456</property>
<!--扩展配置-->
<property name="checkoutTimeout">50000</property>
<property name="idleConnectionTestPeriod">30</property>
<property name="initialPoolSize">10</property>
<property name="maxIdleTime">50</property>
<property name="maxPoolSize">5000</property>
<property name="minPoolSize">10</property>
<property name="maxStatements">200</property>
</default-config>