When the idle period of the current session exceeds the specified threshold, the system automatically closes 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, this error is returned if you execute an SQL statement to query data in the t1 table.
obclient> SELECT * FROM t1;
ERROR 2013 (HY000): Lost connection to MySQL server during query
Troubleshooting procedure
View system parameters related to time.
+---------------------------------+------------------+ | Parameter | 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_timestamp_service | GTS | | 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 | +---------------------------------+------------------+ 21 rows in setSet the
wait_timeoutparameter to28800.obclient> set wait_timeout = 28800; Query OK, 0 rows affectedNote
This parameter specifies the time in seconds that the server waits for an interactive idle connection to become active before closing it.
Set the
interactive_timeoutparameter to28800.obclient> SET interactive_timeout = 28800; Query OK, 0 rows affectedNote
This parameter specifies the time in seconds that the server waits for a non-interactive idle connection to become active before the server closes the connection.
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