The KILL QUERY statement is used to terminate running synchronous and asynchronous SQL statements.

Syntax

KILL QUERY "id"

Example

mysql> kill query "q202003081123hxxxxxxxx"
  • Note: The SHOW QUERY_TASK statement is used to query the ID of the task for which SQL statements you want to terminate are running.