Open My.ini under Windows, add:
interactive_timeout=28800000
wait_timeout=28800000
Expert answer: MySQL is a small relational database management system, because of MySQL small size, speed, low total cost of ownership, especially the characteristics of open source, many small and medium-sized websites in order to reduce the total cost of ownership of the site MySQL as the site database. About MySQL auto-shutdown, you can adjust the connection parameters via MySQL server-side program MySQL administrator. Adjust the max_connections max_updates max_questions three data to a very large number, then your limited operation will not result in the termination of the database service in the MySQL database, if a connection 8 hours without request and operation, will automatically disconnect, This results in errors in some database-based connection applications, especially WEB applications.
Three ways to resolve the MySQL database auto-shutdown service:
Method One: The name of this parameter is Wait_timeout, and its default value is 28,800 seconds (8 hours). Its meaning is to close a connection before the number of seconds in this connection to action, that is, if a connection is idle more than the number of seconds set by this option, MySQL will actively disconnect the connection.
Modify the operation:
Under Linux open/etc/my.cnf, add the following parameters under attribute group mysqld:
[Mysqld]
interactive_timeout=28800000
wait_timeout=28800000
Open My.ini under Windows, add:
[Mysqld]
interactive_timeout=28800000
wait_timeout=28800000
Practice has shown that there is no way to set this value to infinity, that is, permanent.
Therefore, if you cannot guarantee that your application will have at least one operation in the set number of seconds, it is best to solve this problem with a second method.
Method Two: Modify the following JDBC Connection URL:
Dbc:mysql://hostaddress:3306/schemaname?autoreconnect=true add autoreconnect=true This parameter, that can solve the problem.
Method Three: Configuration file (Proxool.xml):
......
Experts recommend that MySQL automatically shut down the service three methods, the user best to take the first approach to the most thorough solution.
How to troubleshoot MySQL database x hours without connection auto-shutdown