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 all commits
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
5 changes: 3 additions & 2 deletions sql-statements/sql-statement-kill.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ 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)。
* 按照设计,`KILL` 语句默认与 MySQL 不兼容。负载均衡器后面通常放有多个 TiDB 服务器,这种默认不兼容有助于防止在错误的 TiDB 服务器上终止连接。
* 请**不要**在配置文件里设置 [`compatible-kill-query = true`](/tidb-configuration-file.md#compatible-kill-query),**除非**你确定客户端将始终连接到同一个 TiDB 节点。这是因为当你在默认的 MySQL 客户端按下 <kbd>ctrl</kbd>+<kbd>c</kbd> 时,客户端会开启一个新连接,并在这个新连接中执行 `KILL` 语句。此时,如果客户端和 TiDB 中间有代理,新连接可能会被路由到其他的 TiDB 节点,从而错误地终止其他会话。
* `KILL TIDB` 语句是 TiDB 的扩展语法,其功能与 MySQL 命令 `KILL [CONNECTION|QUERY]` 和 MySQL 命令行的 <kbd>ctrl</kbd>+<kbd>c</kbd> 相同。在同一个 TiDB 节点上,你可以安全地使用 `KILL TIDB` 语句。

## 另请参阅

Expand Down