Note
This variable is available starting with in 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
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (in Oracle-compatible mode) or theinformation_schema.GLOBAL_VARIABLESview (in MySQL-compatible mode) to query the value of a global system variable.Session level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (in Oracle-compatible mode) or theinformation_schema.SESSION_VARIABLESview (in MySQL-compatible mode) to query the value of a session variable.
Modify variables
Global level
The
systenant can directly modify the value of a global system variable.MySQL-compatible tenants must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.Oracle-compatible tenants must have the
ALTER SYSTEMprivilege to modify the value of a global system variable.
Session variables
The
systenant and all user tenants can directly modify the value of a session system variable in their respective tenant.
Attributes
| Attribute | Description |
|---|---|
| Parameter type | int |
| Default value | 28800 |
| Value range | [1, 31536000] |
| Effective scope | |
| Modifiable | Yes. You can modify the value by using the SET statement. |
Considerations
When a session starts, 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 the mysql_real_connect() function. For more information about the interactive_timeout variable, see interactive_timeout.
Examples
Set the wait time before the server closes a non-interactive connection to 1800 seconds, that is, 30 minutes.
Session level
obclient> SET wait_timeout =1800;Global level
obclient> SET GLOBAL wait_timeout =1800;
References
If you need to set the number of seconds the server waits before closing an interactive connection, see interactive_timeout.