发布网友 发布时间:2022-04-08 04:26
共1个回答
热心网友 时间:2022-04-08 05:56
这个操作等待其它更新释放锁
查询锁记录
SELECT * FROM information_schema.INNODB_TRX;
SELECT * FROM information_schema.innodb_locks;
select r.trx_id wait_trx_id,r.trx_mysql_thread_id wait_thr_id,r.trx_query wait_query,b.trx_id block_trx_id,
b.trx_mysql_thread_id block_thrd_id,b.trx_query block_query,b.trx_started as trx_started_old,r.trx_started as trx_started_new
from information_schema.innodb_lock_waits w inner join information_schema.innodb_trx b on b.trx_id = w.blocking_trx_id inner join information_schema.innodb_trx r on r.trx_id =w.requesting_trx_id;