Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kill: improve kill's description #7007

Merged
merged 4 commits into from
Sep 2, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sql-statements/sql-statement-kill.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ Query OK, 0 rows affected (0.00 sec)
## MySQL 兼容性

* 按照设计,`KILL TIDB` 语句默认与 MySQL 不兼容。负载均衡器后面通常放有多个 TiDB 服务器,这种默认不兼容有助于防止在错误的 TiDB 服务器上终止连接。
* `KILL TIDB` 语句是 TiDB 的扩展语法。如果正尝试终止的会话位于同一个 TiDB 服务器上,可在配置文件里设置 [`compatible-kill-query = true`](/tidb-configuration-file.md#compatible-kill-query)。
* 请**不要**在配置文件里设置 [`compatible-kill-query = true`](/tidb-configuration-file.md#compatible-kill-query),**除非**你确定客户端要始终连接到同一个 TiDB 节点,因为当你在默认的 MySQL 客户端按下 <kbd>ctrl</kbd>+<kbd>c</kbd> 时,客户端会打开一个新连接,并在这个新连接中执行`KILL`语句。此时,如果中间有代理,新连接可能会路由到不同的 TiDB 节点中,从而导致不同的会话可能被终止。
en-jin19 marked this conversation as resolved.
Show resolved Hide resolved
* `KILL TIDB` 语句是 TiDB 的扩展语法,其功能与 MySQL 命令 `KILL [CONNECTION|QUERY]` 和 MySQL 命令行 <kbd>ctrl</kbd>+<kbd>c</kbd> 的功能不相同。在同一个 TiDB 节点中,使用`KILL TIDB`能够安全地终止 TiDB 中的连接。
en-jin19 marked this conversation as resolved.
Show resolved Hide resolved

## 另请参阅

Expand Down