MySQL5.7版本

查看死锁:

select * from information_schema.innodb_locks;

查看锁等待:

select * from information_schema.innodb_lock_waits;

MySQL8.0版本

查看死锁:

select * from performance_schema.data_locks;

查看死锁等待时间:

select * from performance_schema.data_lock_waits;

查看是否自动提交

select @@autocommit;

值为1则开启自动提交,值为0则关闭自动提交