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.
Note: If the Mysqld restart does not take effect, restart the host.