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-02013
Error message
ERROR-02013: Lost connection to MySQL server during query
Examples
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-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 monitor. Commands end with ; or \g. Your OceanBase connection id is 3221635806 Server version: 5.7.25 OceanBase 3.2.3.0 (r20220511132422-590d9fea1ec221fa4ed446e512bd797b35dfae8f) (Built May 11 2022 13:38:24) Copyright (c) 2000, 2018, OceanBase Corporation Ab and others. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. 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 set
2. Set the 'wait_timeout 'parameter to '28800'.
> **Note**
>
>This variable specifies the time in seconds that the server waits for an interactive idle connection to become active before closing it.
```sql
obclient> SET wait_timeout = 28800;
Query OK, 0 rows affected
Set the
interactive_timeoutvariable to28800.Note
This variable specifies the time in seconds that the server waits for a non-interactive idle connection to become active before closing it.
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