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 mode) or theinformation_schema.GLOBAL_VARIABLESview (MySQL 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 mode) or theinformation_schema.SESSION_VARIABLESview (MySQL mode) to obtain the values of session system variables.
Modify variables
Global level
systenants can 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 modify the values of session system variables.
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
When a session is started, 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 global wait_timeout and interactive_timeout values depends on the client type. The client type is defined by the CLIENT_INTERACTIVE option in the mysql_real_connect() connection options. For more information about the interactive_timeout variable, see interactive_timeout.
Examples
Set the time that the server waits for activity before closing a noninteractive connection to 1800 seconds (30 minutes).
Session level
obclient> SET wait_timeout =1800;Global level
obclient> SET GLOBAL wait_timeout =1800;
References
For information about how to set the time that the server waits for activity before closing an interactive connection, see interactive_timeout.