Mysql 查看当前锁住的语句

--查看当前所得事务5.7
select * from information_schema.INNODB_TRX;
--查看锁5.7
select * from information_schema.INNODB_LOCKS;
--查看锁等待5.7
select * from information_schema.INNODB_LOCK_WAITS;

#查看死锁8.0
select * from performance_schema.data_locks;
#查看死锁等待时间8.0
select * from performance_schema.data_lock_waits;

查询出卡主的 trx_id kill 死他
kill trx_id

你可能感兴趣的:(Linux,数据库,sql)