Skip to content

Commit

Permalink
Update KILL TIDB descriptions for v5.3 (#15612) (#16976)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Apr 7, 2024
1 parent 312b8c8 commit 95ce9c4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions sql-statements/sql-statement-kill.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,31 @@ mysql> SHOW PROCESSLIST;
| 2 | root | 127.0.0.1 | | Sleep | 4 | 2 | |
+------+------+-----------+------+---------+------+-------+------------------+
2 rows in set (0.00 sec)
```

You can get the TiDB Server details of a session to be killed by querying the `INSTANCE` column of `INFORMATION_SCHEMA.CLUSTER_PROCESSLIST`:

```sql
SELECT ID, USER, INSTANCE, INFO FROM INFORMATION_SCHEMA.CLUSTER_PROCESSLIST;
```

```sql
+---------------------+------+-----------------+-----------------------------------------------------------------------------+
| ID | USER | INSTANCE | INFO |
+---------------------+------+-----------------+-----------------------------------------------------------------------------+
| 1 | root | 127.0.0.1:10082 | SELECT ID, USER, INSTANCE, INFO FROM INFORMATION_SCHEMA.CLUSTER_PROCESSLIST |
| 2 | root | 127.0.0.1:10080 | |
+---------------------+------+-----------------+-------------------------------------------------------------
2 rows in set (0.00 sec)
```

To execute the `KILL TIDB` statement, connect to the TiDB node where the session needs to be killed:

```shell
mysql -h 127.0.0.1 -P 10080 -u root -p
```

```sql
KILL TIDB 2;
Query OK, 0 rows affected (0.00 sec)
```
Expand Down

0 comments on commit 95ce9c4

Please sign in to comment.