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-02013
Error message
ERROR-02013: Lost connection to MySQL server during query
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-02013: Lost connection to MySQL server during query
Troubleshooting procedure
Method 1
Reconnect to the Oracle database.
Reconnect the
SYSuser.[admin@k08j13249.eu95sqa /home/admin] $obclient -h172.10.10.10 -P1000 -usys@Oracle -p -A Enter password: Welcome to the OceanBase. Commands end with ; or \g. Your OceanBase connection id is 3221583828 Server version: OceanBase 3.2.4.0 (r100000072022102819-2a28da9e758e2d232c41fa1a1b0070a08b77dd7d) (Built Oct 28 2022 19:46:38) Copyright (c) 2000, 2018, OceanBase Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.Query data in the
t1table again.obclient> SELECT * FROM t1; +----+------+-------+------------------------------+ | ID | NAME | VALUE | GMT_CREATE | +----+------+-------+------------------------------+ | 1 | CN | NULL | 12-MAY-22 11.29.49.782106 AM | | 2 | UK | NULL | 12-MAY-22 11.29.49.782106 AM | | 3 | US | NULL | 12-MAY-22 11.29.49.782106 AM | +----+------+-------+------------------------------+ 3 rows in set
Method 2
Modify session timeout parameters.
Query the
wait_timeoutvariable in thevariablesview.obclient> SHOW variables WHERE VARIABLE_NAME = 'wait_timeout'; +---------------+-------+ | VARIABLE_NAME | VALUE | +---------------+-------+ | wait_timeout | 10 | +---------------+-------+ 1 row in setSet the
wait_timeoutparameter to28800.Note
This parameter specifies the time in seconds that the server waits for an interactive idle connection to become active before closing it.
obclient> SET wait_timeout = 28800; Query OK, 0 rows affectedSet the
interactive_timeoutparameter to28800.Note
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.
obclient> SET interactive_timeout = 28800; Query OK, 0 rows affectedQuery data in the
t1table again.obclient> SELECT * FROM t1; +----+------+-------+------------------------------+ | ID | NAME | VALUE | GMT_CREATE | +----+------+-------+------------------------------+ | 1 | CN | NULL | 12-MAY-22 11.29.49.782106 AM | | 2 | UK | NULL | 12-MAY-22 11.29.49.782106 AM | | 3 | US | NULL | 12-MAY-22 11.29.49.782106 AM | +----+------+-------+------------------------------+ 3 rows in set