数据库连接错误mysql,tomcat

kx7yvsdv  于 2021-07-09  发布在  Java
关注(0)|答案(0)|浏览(212)

我使用下面的dbcp设置来连接池

maxActive = 50
maxIdle = 10
minIdle = 2
initialSize = 2
maxWait = 30000
validationQuery="select 1"
testOnBorrow=true
testWhileIdle=true
timeBetweenEvictionRunsMillis=60000

另外,我在连接url中将auto\ u reconnect设置为true。我经常看到以下错误。

com.mysql.jdbc.CommunicationsException: 
The last communications with the server was 28810 seconds ago,
which is longer than the server configured value of 'wait_timeout'. 
You should consider either expiring and/or testing connection validity
before use in your application, increasing the server configured values
for client timeouts, or using the Connector/J connection property
'autoReconnect=true' to avoid this problem

有人知道这里怎么了吗?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题