SELECT
r.trx_id AS '事务ID',
r.trx_state AS '事务状态',
r.trx_started AS '事务开始时间',
r.trx_wait_started AS '等待开始时间',
l.lock_table AS '表',
l.lock_index AS '索引',
l.lock_mode AS '锁模式',
r.trx_mysql_thread_id AS '线程ID'
FROM
information_schema.innodb_trx r
INNER JOIN information_schema.innodb_locks l ON r.trx_id = l.lock_trx_id
WHERE
r.trx_state != 'IDLE'
ORDER BY
r.trx_started;
标签:事务,started,lock,trx,mysql,锁定,id
From: https://www.cnblogs.com/badake/p/17594030.html