After a version of MySQL 5.x, the feature of the automatic shutdown idle connection of MySQL is modified, if a connection is idle to timeout (default 28,000 seconds 8 hours), the Reconnect reconnection request is not accepted, and a new connection needs to be established. This leads to a ser mechanism that does not work: Ser only uses the same connection interface when it needs to operate the database, disconnects the request if it is disconnected, and the problem is not ser to be resolved in the short term.
The following are specific ways to deal with:
1. Use MySQL 4.0 or 4.1, if you don't use some of the new features of MySQL 5, such as stored procedure triggers.
2. Timed reboot MySQL server or ser (because this problem may also affect some other need MySQL support server program, so restart MySQL server is good, but need to detect MySQL server is not used a time restart more difficult to determine)
3. Set MY.CNF, there are mysqld fields to add parameters:
[Mysqld]port = 3306socket =/tmp/mysql.sockwait_timeout= 500000interactive_timeout = 500000 (500,000 seconds timeout of approximately five or six days, Depending on your actual needs, you can choose a time value that is slightly larger than the maximum time that a database may be idle. Restart the mysqld application, or you can add the-o wait_timeout=500000 parameter to the same effect when the mysqld is executed.
In the MySQL client show variable should be able to see the last one from the default wait_time=28000 into 500000.
(If reboot mysqld does not take effect, can reboot machine)