关键词搜索

源码搜索 ×
×

mysql longer than the server configured value of ‘wait_timeout‘

发布2022-10-28浏览511次

详情内容

问题现象:
com.mysql.jdbc.CommunicationsException: The last packet successfully received from the server was58129 seconds ago.The last packet sent successfully to the server was 58129 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.

解决办法:
mysql4.x版本 设置autoReconnect=true
mysql5以上的,修改my.ini配置文件,在mysqld下面添加以上两行,后面的数字是时间

[mysqld]
wait_timeout=31536000 
interactive_timeout=31536000 

    相关技术文章

    点击QQ咨询
    开通会员
    返回顶部
    ×
    微信扫码支付
    微信扫码支付
    确定支付下载
    请使用微信描二维码支付
    ×

    提示信息

    ×

    选择支付方式

    • 微信支付
    • 支付宝付款
    确定支付下载