MySql版本:5.5
部署的一个Web服务,日志报错:
The last packet successfully received from the server was 246,418,715 milliseconds ago. The last packet sent successfully to the server was 246,418,715 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
查询数据库的time_out变量:

原来是MySql数据库默认,wait_timeout是28800秒,如果8小时不连接数据库,就把这个连接断掉。
本文探讨了MySQL数据库连接超时的原因及解决方案。通过调整wait_timeout参数,避免因长时间未操作导致连接断开的问题。
378

被折叠的 条评论
为什么被折叠?



