Here’s the basics:
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
Now these results can be a bit daunting, so you might want to refine your lookup — especially if you have at least a vague idea of what your expecting to find:
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO REGEXP 'FROM too_many_rows_why_did_i_do_this';
As you may know, the output is the same as executing the following:
SHOW FULL PROCESSLIST;
However, unlike the above, you can run full SELECT queries against it.
Note: applies only to MySQL versions >= 5.1.17