mysql查询死锁表 Unknown table ‘INNODB_LOCKS‘ in information_schema

mysql查询死锁表

mysql 8.0 版本跟之前是不一样的,网上到处都是
 # 查询死锁表
 SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS;
# 查询死锁等待时间
 SELECT * FROM information_schema.INNODB_LOCK_waits;

在8.0版本之前会报


Unknown table 'INNODB_LOCKS' in information_schema

Unknown table 'INNODB_LOCK_WAITS' in information_schema

8.0版本之后替换为


 select * from performance_schema.data_locks;

 select * from performance_schema.data_lock_waits;

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