interactive_timeout
Idle timeout for interactive clients such as the mysql command-line client.
- 기본값
28800 (8 hours)- Range
- 1 to 31536000 seconds
- Restart needed
- 아니요
- Default checked on
- MySQL 8.4 LTS
기능
When a client connects with CLIENT_INTERACTIVE, its session wait_timeout is initialized from this value.
기본값
28800 (8 hours). 28800 seconds (MySQL 8.4).
Check the current value
SHOW GLOBAL VARIABLES LIKE 'interactive_timeout'; SELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME FROM performance_schema.variables_info WHERE VARIABLE_NAME = 'interactive_timeout';
Change it
SET SESSION interactive_timeout = 3600; -- this connection SET GLOBAL interactive_timeout = 3600; -- new connections, until restart SET PERSIST interactive_timeout = 3600; -- new connections, and after restarts
No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.
When to change it
Lower it if forgotten shell sessions hold locks or connections.
What can go wrong
Low.
Questions about interactive_timeout
What is the default value of interactive_timeout in MySQL?
28800 (8 hours). 28800 seconds (MySQL 8.4).
Does changing interactive_timeout require a restart?
No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.
When should I change interactive_timeout?
Lower it if forgotten shell sessions hold locks or connections.
Back to all MySQL settings, or check the MySQL manual for every option.
Related on SQLly
Check interactive_timeout on your own server
SQLly runs the query above against MySQL and the other engines in this reference, from one desktop app on macOS, Windows and Linux.