MySQL 连接Timeout

问题

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

MySQL 连接Timeout

上一篇:Mac OSX 平台 MongoDB 的安装及维护


下一篇:iframe嵌套findBI报错拒绝访问