Stopping an errant query
Suppose we launch a complex search and notice that the browser is waiting for the results. This might happen with a database search but also with a single-table search. We can instruct the browser to stop but this will only tell the web server to cease handling our request. However, at this point the MySQL server process is busy, possibly doing a complex join or a full table scan. Here is a method to stop this errant query:
We open a different browser (for example, the errant query was launched via Firefox and we open Internet Explorer).
We log in via phpMyAdmin to MySQL with the same account.
On the home page, we click on Processes.
At this point, we should see a process identified by Query under the Command column and containing the errant query (other than
SHOW PROCESSLIST
which is not the one to kill).We click on Kill for this process.
To verify, we can immediately click again on Processes and the chosen process should now be identified as Killed instead of Query...