MySQL5 7 连接池的连接timeout问题

本文介绍了在遇到MySQL数据库8小时超时问题时的解决方法,包括在线修改数据库设置以延长超时时间,以及在Spring连接池配置中启用异步验证查询以确保连接有效性。通过调整配置,避免了因数据库连接失效导致的应用问题。
摘要由CSDN通过智能技术生成

分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow

也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!

               

1,线上监控人员报错,tomcat下的应用连接数据库问题:

--- Cause:  com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet  successfully received from the server was 99,634,779 milliseconds ago.  The last packet sent successfully to the  server was 99,634,781 milliseconds ago. 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.; nested exception is  com.ibatis.common.jdbc.exception.NestedSQLException:  

 

--- The error occurred in  META-INF/sqlmap/IB_BRAND_sqlmap.xml. 

 

--- The error occurred while applying a  result map. 

 

--- Check the IB_BRAND.IbBrandResult. 

 

--- Check the result mapping for the  'ibBrandDetail' property. 

 

--- Cause:  com.ibatis.common.jdbc.exception.NestedSQLException:  

 

--- The error occurred in  META-INF/sqlmap/IB_BRAND_DETAIL_sqlmap.xml.  

 

--- The error occurred while applying a  parameter map. 

 

--- Check the  IB_BRAND_DETAIL.selectByBrandId-InlineParameterMap. 

 

--- Check the statement (query  failed). 

 

--- Cause:  com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet  successfully received from the server was 99,634,779 milliseconds ago.  The last packet sent successfully to the  server was 99,634,781 milliseconds ago. is longer than the server configured  value of 'wai

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值