|Subject:||Why do I lose connection to MySQL after some time?|
|Creation date:||7/29/09 2:42 PM|
|Last modified on:||7/29/09 2:42 PM|
By default, MySQL server terminates a client connection after 28800 seconds of inactivity. Often database administrators change this value to a lower number. This results in a broken connection if the user does not submit any query for a long period of time.
Type the following query to see what the current setting is for this variable.
SHOW VARIABLES like 'interactive_timeout'
In addition to 'interactive_timeout', you might also want to check the value for 'wait_timeout. Refer to MySQL documentation for a detailed description of these parameters.
To set a new value for these parameters, you can use the SET command. For example:
IMPORTANT: There is no configuration setting in WinSQL (the client) that automatically terminates a connection. Therefore, the only way to fix this problem is to change the configuration parameter on the server.
Do you have a helpful tip related to this document that you'd like to share with other users?