In Web scripting, some calculations and applications can be time-consuming, such as opening a database in 0 seconds after the execution of a SQL code, the page script takes 20 seconds to perform a complex operation, or require a large PHP file (such as a filter function with thousands of offending keywords), This time in the MySQL background to see the process, this 20-second process of MySQL did not do anything, has been in sleep state, until this page executed or reached the Wait_timeout value (forcibly closed), optimize the page script, try to get the program to run quickly, or during the execution of this time-consuming run, execute mysql_close to force the current MySQL link to close
1. Is to modify the configuration my.cnf
wait_timeout=10
Restart MySQL (not recommended)
2. is directly into MySQL
setglobalwait_timeout=10;
show globalvariables like‘%timeout‘;
mysql resolves the sleep process