You are viewing an older version of this section. View current production version.


Kill the connection on the specified thread. Rolls back any query running on the thread.


KILL [CONNECTION | QUERY] <internal_process_id>;


  • internal_process_id - ID of the thread to kill, which can be found by running SHOW_PROCESSLIST.
  • KILL CONNECTION Will disconnect the client associated with internal_process_id. This is the default, meaning that running KILL <> will have the same result.
  • KILL QUERY Will not disconnect the client associated with internal_process_id. Instead, the client will receive an error.
  • Any query running on the connection will be rolled back.
  • MemSQL checks for the kill bit during any potentially long running loop during query execution and rolls back the query’s transaction if the kill bit is set.
  • This command must be run on the same node as the query to be killed.
  • This command should be run on the master aggregator or a child aggregator node (see Node Requirements for MemSQL Commands).


memsql> KILL CONNECTION 3123;
Query OK, 0 rows affected (0.00 sec)

Related Topics