查询数据库被锁/等待的线程sql

  • Post author:
  • Post category:其他


1、查询被锁的进程

select * from information_schema.INNODB_LOCKS;

2、查询等待中的进程。

select * from information_schema.INNODB_LOCK_WAITS;

3、查询被锁的sql

select trx_state, trx_started, trx_mysql_thread_id, trx_query from information_schema.innodb_trx;



版权声明:本文为hanshanyunhai原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。