The KILL command is the primary mechanism for terminating a MySQL connection or a specific executing query. While simple in concept, its behavior varies significantly based on transaction storage engines (especially InnoDB), connection states, and the specific KILL modifier used. Misuse can lead to transaction rollback delays, metadata locks, or even temporary connection storms.
| Command | Purpose | | :--- | :--- | | SHOW FULL PROCESSLIST | View all running threads and full queries. | | KILL <id> | Kill the query and close the connection. | | KILL QUERY <id> | Kill the query but keep the connection open. | mysql kill process