MySQL SHOW PROCESSLIST
To kill a query, we first need to track down the query that is slowing the performance - it's usually the one that takes the most time to run.
For that measure, we need to look at the table that will show running MySQL queries which is done by the processlist command:
show full processlist;
The FULL modifier allows us to see the query text in its entirety instead of the first 100 symbols we would get without this modifier.
In the id column, you will see the connection thread id of any currently running query - you can then use this id in the KILL command.
You can also retrieve detailed information about connections using the following queries:
SELECT * FROM information_schema.PROCESSLIST p;
SELECT * FROM performance_schema.threads t;