SELECT
b.ID AS '事务ID',
a.TRX_STATE AS '事务状态',
b.TIME AS '运行时间(秒)',
b.HOST AS '客户端主机',
b.STATE AS '状态描述',
b.DB AS '数据库名称',
a.TRX_QUERY AS 'SQL语句',
a.TRX_WEIGHT '事务的权重(模糊行数)',
a.TRX_ROWS_LOCKED AS '事务当前锁定的行数',
a.TRX_ROWS_MODIFIED AS '事务已修改的行数',
a.TRX_STARTED AS '事务开始时间',
b.USER AS 'MySQL用户名',
b.COMMAND AS '命令类型',
CONCAT( 'KILL QUERY ', b.ID, ';' ) AS '停止任务',
CONCAT( 'KILL ', b.ID, ';' ) AS '停止任务并断开链接'
FROM
INFORMATION_SCHEMA.INNODB_TRX a
LEFT JOIN INFORMATION_SCHEMa.PROCESSLIST b ON b.ID = a.TRX_MYSQL_THREAD_ID
ORDER BY
b.TIME DESC
mysql事务查看
最新推荐文章于 2024-08-23 17:37:15 发布