SHOW ENGINE INNODB STATUS G
寻找部分-
TRANSACTIONS
我们可以使用 INFORMATION_SCHEMA 表。
有用的查询
要检查所有锁事务正在等待:
USE INFORMATION_SCHEMA;SELECt * FROM INNODB_LOCK_WAITS;
阻止交易的列表:
SELECt * FROM INNODB_LOCKS WHERe LOCK_TRX_ID IN (SELECt BLOCKING_TRX_ID FROM INNODB_LOCK_WAITS);
要么
SELECt INNODB_LOCKS.* FROM INNODB_LOCKSJOIN INNODB_LOCK_WAITS ON (INNODB_LOCKS.LOCK_TRX_ID = INNODB_LOCK_WAITS.BLOCKING_TRX_ID);
特定表上的锁列表:
SELECt * FROM INNODB_LOCKS WHERe LOCK_TABLE = db_name.table_name;
等待锁的事务列表:
SELECt TRX_ID, TRX_REQUESTED_LOCK_ID, TRX_MYSQL_THREAD_ID, TRX_QUERYFROM INNODB_TRXWHERe TRX_STATE = 'LOCK WAIT';
参考 -
MySQL的故障排除:怎么办时,查询不工作,第6章-第96页。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)