Show all active & sleeping queries in MySQL

Check all active and queries running in MySQL

SELECT * FROM information_schema.PROCESSLIST ORDER BY INFO DESC, TIME DESC;

Check with timing of all active or sleeping queries in MySQL

SELECT ID, USER, HOST, DB, COMMAND,
TIME as time_seconds,
ROUND(TIME / 60, 2) as time_minutes,
ROUND(TIME / 60 / 60, 2) as time_hours,
STATE, INFO
FROM information_schema.PROCESSLIST ORDER BY INFO DESC, TIME DESC;

Leave a Reply