MySQL database death and denial of service methods from Mysql 5. after a version of x, the feature of MySQL to automatically close idle connections has been modified. for example, if a connection is idle to a timeout time (the default value is 28000 seconds and 8 hours ), re-initiated Reconnect reconnection requests will not be accepted, and new connections need to be re-established, which causes the re-connection mechanism of SER to fail: the SER only uses the same connection interface when it needs to operate the database. if it is disconnected, it initiates a reconnection request. In addition, this problem cannot be solved by the SER in a short period of time.
The solution is described as follows:
1. use Mysql 4.0 or 4.1 if some new features such as stored procedure triggers of Mysql 5 are not used.
2. regularly restart the Mysql server or Ser (because this problem may also affect other server programs that require Mysql support, it is better to restart the Mysql server, however, it is difficult to determine the time when the Mysql server is not used for restart)
3. set my. cnf and add parameters in the mysqld field:
[Mysqld] port = 3306 socket =/tmp/mysql. sockwait_timeout = 500000interactive_timeout = 500000 (timeout of about five or six days in 500000 seconds, you can select a time value that may be idle for a database as needed .) Restart the Mysqld application. you can also add the-o wait_timeout = 500000 parameter when executing mysqld.
When you show variable on the MySQL client, you can see that the last line is changed from the default wait_time = 28000 to 500000.
(If the Mysqld restart does not take effect, restart the host)