When the idle period of the current session exceeds the specified threshold, the system will proactively close the current session. This topic describes the idle session timeout error and the troubleshooting procedure.
Error: ERROR 2013
Error code
2013
Example
After the current session remains idle for a period longer than the specified threshold, if you execute an SQL statement to query data in the t1 table, this error will be returned.
obclient> SELECT * FROM t1;
ERROR 2013 (HY000): Lost connection to MySQL server during query
Troubleshooting procedure
View system variables related to time.
obclient> SHOW VARIABLES LIKE '%time%'; +---------------------------------+------------------+ | Variable_name | Value | +---------------------------------+------------------+ | connect_timeout | 10 | | default_password_lifetime | 0 | | error_on_overlap_time | OFF | | explicit_defaults_for_timestamp | ON | | interactive_timeout | 28800 | | lock_wait_timeout | 31536000 | | long_query_time | 10 | | max_execution_time | 0 | | net_read_timeout | 30 | | net_write_timeout | 60 | | ob_pl_block_timeout | 3216672000000000 | | ob_query_timeout | 10000000 | | ob_trx_idle_timeout | 120000000 | | ob_trx_lock_timeout | -1 | | ob_trx_timeout | 100000000 | | system_time_zone | +08:00 | | timestamp | 0 | | time_format | %H:%i:%s | | time_zone | +8:00 | | wait_timeout | 28800 | +---------------------------------+------------------+ 20 rows in setSet the
wait_timeoutvariable to28800.obclient> set wait_timeout = 28800; Query OK, 0 rows affectedNote
This variable specifies the time in seconds that the server waits for an interactive idle connection to become active before closing it.
Set the
interactive_timeoutvariable to28800.obclient> set interactive_timeout = 28800; Query OK, 0 rows affectedNote
This variable specifies the time in seconds that the server waits for a non-interactive idle connection to become active before closing it.
Query data in the
t1table again.obclient> SELECT * FROM t1; +----+---------------------+---------------------+ | id | gmt_create | gmt_modified | +----+---------------------+---------------------+ | 1 | 2022-03-16 14:23:10 | 2022-03-16 14:23:10 | | 2 | 2022-03-16 14:23:10 | 2022-03-16 14:23:10 | | 3 | 2022-03-16 14:23:10 | 2022-03-16 14:23:10 | +----+---------------------+---------------------+ 3 rows in set