关于dbcp配置的问题
dbcp配置如下:
driverClassName=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/t_xx?autoReconnect=true&useUnicode=true&characterEncoding=utf8
username=root
password=123456
initialSize=2
maxActive=10
maxIdle=2
minIdle=1
maxWait=30000
removeAbandoned=true
removeAbandonedTimeout=180
但是按照这个配置部署项目时,报以下错误:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was40925 milliseconds ago.The last packet sent successfully to the server was 40925 milliseconds 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.
请问这个是配置方面的问题吗?如果是,应该如何配置呢?请指导哈...谢谢!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我试试看,谢谢了...
注意连接池里连接的空闲时间应该小于 MySQL 配置里的 wait_timeout 的值