Toshimaru's Blog

Filter MySQL processlist

You can see MySQL processes by show processlist.

show processlist;

But, it can’t be filtered. If you’d like to retrieve processes like usual SQL syntax, it can be replaced with:

SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;

Now, you can filter process with WHERE clause.

SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE DB = 'development' AND USER = 'myuser';

See also