SELECT i.trx_started, -- 事务开始时间
i.trx_mysql_thread_id, -- 线程号,有紧急需要处理的时候kill这个线程,慎用
p.HOST, -- 机器ip
p.COMMAND , -- 运行状态
p.`TIME` , -- 执行时间
c.SQL_TEXT -- sql语句
FROM INFORMATION_SCHEMA.INNODB_TRX i
left join information_schema.PROCESSLIST p on i.trx_mysql_thread_id = p.ID
left join performance_schema.threads t on i.trx_mysql_thread_id =
t.PROCESSLIST_ID
left join performance_schema.events_statements_current c on c.THREAD_ID =
t.THREAD_ID
order by i.trx_started desc
image.png
网友评论