Note
This variable is available starting with V1.4.
Description
wait_timeout specifies the number of seconds that the server waits for activity before closing a noninteractive connection.
Privilege requirements
Query variables
Global level
systenants and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (Oracle-compatible mode) or theinformation_schema.GLOBAL_VARIABLESview (MySQL-compatible mode) to obtain the values of global system variables.Session level
systenants and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (Oracle-compatible mode) or theinformation_schema.SESSION_VARIABLESview (MySQL-compatible mode) to obtain the values of session system variables.
Modify variables
Global level
systenants can directly modify the values of global system variables.MySQL user tenants must have the
SUPERorALTER SYSTEMprivilege to modify the values of global system variables.Oracle user tenants must have the
ALTER SYSTEMprivilege to modify the values of global system variables.
Session level
systenants and all user tenants can directly modify the values of session system variables for their own tenants.
Attributes
| Attribute | Description |
|---|---|
| Type | Int |
| Default value | 28800, in seconds |
| Value range | [1, 31536000] |
| Scope |
|
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Usage notes
At session startup, the system initializes the session wait_timeout value based on the global wait_timeout value or the global interactive_timeout value. The choice between the two 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.
Examples
Set the server to wait for 1800 seconds (30 minutes) before closing a noninteractive connection.
Session level
obclient> SET wait_timeout =1800;Global level
obclient> SET GLOBAL wait_timeout =1800;
References
For information about how to set the number of seconds that the server waits for activity before closing an interactive connection, see interactive_timeout.