By default, the server closes the connection after 8 hours if nothing has happened. You can change the time limit by setting the wait_timeout variable when you start mysqld. You can change the time limit by setting the wait_timeout variable when you start mysqld via your server's /etc/my.cnf as well.
既然8小时断开,增加timeout是没用的,迟早要断。
非常感谢各位回答,可惜初来乍到没分送上。
You can change the time limit by setting the wait_timeout variable when you start mysqld via your server's /etc/my.cnf as well.
每5分种 定期写mysql时, 重新建立一个连接, 写完后 关闭连接
每8小时会捕获一次connection closed。
我并不想知道该怎么做,我只是我觉得奇怪的是明明在不停地写,每分钟都会有数据写入mysql的,但为什么还会出现wait_timeout.
看一下连接,里面有IDLE的时间我想大概就是打开多连接的问题了.