查看mysql当前事务锁并kill
执行如下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命令可以终止线程。
作者:Lave Zhang
出处:http://www.cnblogs.com/lavezhang/
本文版权归作者所有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。