Overview
wait_timeout specifies the number of seconds the server waits for active non-interactive connections before closing them.
Privilege requirements
Query variables
Global level
Both the
systenant and all user tenants can use theSHOW VARIABLESstatement and theinformation_schema.GLOBAL_VARIABLESview to view the values of global system variables.Session level
Both the
systenant and all user tenants can use theSHOW VARIABLESstatement and theinformation_schema.SESSION_VARIABLESview to view the values of session system variables.
Modify variables
Global effective
The
systenant can directly modify the values of global system variables.The user tenant must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.
Session expiration
The
systenant and all user tenants can directly modify the values of session system variables for their own tenants.
Attributes
Attribute |
Description |
|---|---|
| Parameter type | Int |
| Default Value | 28800, in seconds |
| Value range | [1, 31536000] |
| Effective Scope |
|
| Modifiable | Yes, you can use theSETStatement modification. |
Usage instructions
When a session is started, the system initializes the session's wait_timeout value based on either the global wait_timeout or interactive_timeout. Which of these two values is used depends on the client type. The client type is defined by the CLIENT_INTERACTIVE connection option in mysql_real_connect(). For more information about the interactive_timeout variable, see interactive_timeout.
Configuration example
Set the time before the server closes inactive non-interactive connections to 1800 seconds, which is 30 minutes.
Session Validity Period
obclient> SET wait_timeout =1800;Effective globally
obclient> SET GLOBAL wait_timeout =1800;
References
To set the number of seconds the server waits for active interactions before closing them, see interactive_timeout.