This topic describes how to end the execution of an SQL statement in a DRDS database by executing the KILL statement.

Prerequisites

You must connect to the DRDS database before you can end the execution of an SQL statement in the DRDS database by executing the KILL statement. For more information about how to connect to a DRDS database, see Step 4: Connect to DRDS.

Syntax

The syntax of the KILL command supports the following usages.

  • You can execute the following statement to end the execution of logical and physical SQL statements on a connection and end the connection.
    KILL PROCESS_ID
    Note
    • You can execute the SHOW [FULL] PROCESSLIST statement to query PROCESS_ID.
    • DRDS databases do not support KILL QUERY statements.
  • You can execute the following statement to end the execution of a specific physical SQL statement.
    KILL 'PHYSICAL_PROCESS_ID'

    Example

    mysql> KILL '0-0-521570'; 
    Query OK, 0 rows affected (0.01 sec)
    Note
    • You can execute the SHOW PHYSICAL_PROCESS_ID statement to query PHYSICAL_PROCESS_ID.
    • Values in the PHYSICAL_PROCESS_ID column are strings rather than numbers. Therefore, you must enclose the PHYSICAL_PROCESS_ID value in this statement with single quotation marks (').
  • You can execute the following statement to end the execution of all the physical SQL statements in a DRDS database.
    KILL 'ALL'