运维开发网

MySQL 连接Timeout

运维开发网 https://www.qedev.com 2021-01-14 14:34 出处:51CTO 作者:MT的博客
问题MySQL会在一定周期的为连接前提下报错,如下ThelastpacketsuccessfullyreceivedfromtheserverwasXXXmillisecondsago.Thelastpacketsentsuccessfullytotheserverwas0millisecondsago.原因MySQLServer端这边因为超时断开了客户端发起的TCP连接,而客户端此时并不知道,尝

问题

MySQL会在一定周期的为连接前提下报错,如下

The last packet successfully received from the server was XXX milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.

原因

MySQL Server 端这边因为超时断开了客户端发起的TCP连接,而客户端此时并不知道,尝试通过原有通道连接时,报错

解决方案

将MySQL Server的wait_timeout参数改成1800或者更大即可

MySQL 连接Timeout

具体相关参数详情亦可参照官网

https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_wait_timeout

扫码领视频副本.gif

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号