mysql 锁相关的视图
查看事务,以及事务对应的线程ID 如果发生堵塞、死锁等可以执行kill 线程ID 杀死线程 kill 199
SELECT * FROM information_schema.INNODB_TRX
SELECT * FROM information_schema.INNODB_LOCKS
查看事务堵塞的情况
SELECT * FROM information_schema.innodb_lock_waits
requesting_trx_id
requested_lock_id
blocking_trx_id
blocking_lock_id