What is the default MySQL wait_timeout and interactive_timeout value?

Referring to the MySQL Manual the default values for wait_timeout and for interactive_timeout are - 28800.

On thread startup, the session wait_timeout value is initialized from the global wait_timeout value or from the global interactive_timeout value, depending on the type of client (as defined by the CLIENT_INTERACTIVE connect option to mysql_real_connect()). See also interactive_timeout.


I have the same problem in 5.5.43. I was having the "has gone away" error message for some long queries beyond about 2 minutes. So I tried these 3:

(1) SHOW VARIABLES LIKE 'wait_%';

(2) SHOW global VARIABLES LIKE 'wait_%'; and

(3) SHOW session VARIABLES LIKE 'wait_%'; .

All showed wait_timeout to be 28800. Then I added wait_timeout = 31536000 to /etc/my.cnf. Then my long query was able to complete. And from the 3 ways of showing variables above, only (2) the one with "global" showed a change from 28800 to 31536000. The other 2 were unaffected. Since my long-query was definitely less than 10 minutes long, does this mean that the unit of time used here was milliseconds rather than seconds?


Referring to the MySQL Manual the default values for -

wait_timeout and for interactive_timeout are - 28800 seconds

REMEMBER - seconds (28800 in seconds)

Tags:

Mysql

Timeout