It is unknown that the connection has expired. If a Client requests a connection, providing the Connection to the Client will cause the above exception.
8 hours in idle status.
;
Set global wait_timeout =;
Mysql> show variables like '% timeout % ';
+ -------------------------- + ------- +
| Variable_name | Value |
+ -------------------------- + ------- +
| Connect_timeout | 5 |
| Delayed_insert_timeout | 300 |
| Innodb_lock_wait_timeout | 50 |
| Interactive_timeout | 28800 |
| Net_read_timeout | 30 |
| Net_write_timeout | 60 |
| Slave_net_timeout | 3600 |
| Wait_timeout | 28800 |
+ -------------------------- + ------- +
At the same time, only one of these two parameters works. Which parameter takes effect depends on the connection parameter specified during user connection. wait_timeout is used by default. I suggest modifying both parameters to avoid unnecessary troubles.
Set these two parameters to 1 year (60*60*24*365 = 31536000)
Set interactive_timeout = 31536000;
Set wait_timeout = 31536000;
MySQL times out idle connections after 8 hours (28,800 seconds)
MySQL idle timeout