执行如下SQL,查看当前事务:
select t.trx_mysql_thread_id, t.trx_started, t.trx_state, t.trx_tables_in_use, t.trx_tables_locked, t.trx_rows_locked, timestampdiff(second, t.trx_started, now()) as trx_run_seconds, concat(e.timer_wait/1000000000000, 's') as timer_wait_seconds from information_schema.innodb_trx t join performance_schema.threads c on c.processlist_id=t.trx_mysql_thread_id join performance_schema.events_statements_current e on e.thread_id=c.thread_id
返回是trx_mysql_thread_id就是线程ID,通过kill命令可以终止线程。
标签:查看,thread,trx,kill,mysql,id,schema From: https://www.cnblogs.com/lavezhang/p/16984761.html