Check the currently running query in MariaDB / MySQL

Check the currently running query in MariaDB / MySQL

Show the process with the process list command including sleeping and running

SHOW [FULL] PROCESSLIST 

SHow PROCESSLIST \G

Check the currently running query in the info column:



select * from information_schema.PROCESSLIST p where info is not null;

Enable the trace for running SQL query by enabling general log :


set global log_output = 'table';
set global general_log = 'on';

select * from mysql.general_log;

select event_time as time,
    user_host,
    thread_id,
    server_id,
    command_type,
    argument
from mysql.general_log
order by event_time desc
limit 1;

Leave a Reply