Troubleshooting
In a complex application scenario, connections and query tasks may enter an erroneous state or take too long to finish, necessitating methods to terminate these connections or tasks.
Terminate Connection
KILL CONNECTION conn_id;
conn_id can be obtained through SHOW CONNECTIONS
.
Terminate Query
KILL QUERY 'kill_id';
kill_id can be obtained through SHOW QUERIES
.
Terminate Transaction
KILL TRANSACTION trans_id
trans_id can be obtained through SHOW TRANSACTIONS
.
Reset Client Cache
RESET QUERY CACHE;
If metadata synchronization issues occur in a multi-client environment, this command can be used to forcibly clear the client cache, after which the client will pull the latest metadata from the server.