首页 > 数据库 >mysql longer than the server configured value of ‘wait_timeout‘

mysql longer than the server configured value of ‘wait_timeout‘

时间:2022-10-29 19:37:00浏览次数:39  
标签:longer configured successfully value server packet timeout wait


问题现象:

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


标签:longer,configured,successfully,value,server,packet,timeout,wait
From: https://blog.51cto.com/gblfy/5806453

相关文章