| Command | Effect | | :--- | :--- | | KILL QUERY 12345; | Terminates the but keeps the connection open. | | KILL CONNECTION 12345; (or just KILL 12345 ) | Terminates the query and closes the connection. |
In the life of a database administrator or backend developer, there comes a moment of panic: a runaway SELECT statement is locking a critical table, an UPDATE without a WHERE clause is rewriting millions of rows, or a stalled transaction is grinding the application to a halt. The solution? Terminate the offending process. kill mysql query
KILL 12345; Or with the optional CONNECTION keyword (same effect): | Command | Effect | | :--- |