mysql事务死锁处理

 

有时候执行sql语句后,一直没有结果,即可能出现了事务死锁

select * from information_schema.innodb_trx;

kill trx_mysql_thread_id;

 

查看当前的锁

select * from information_schema.innodb_locks;

 

查看是否锁表

show open tables where in_use>0;

 

查看等待锁的事务

select * from information_schema.innodb_lock_waits;

 

posted @ 2022-07-11 23:49  opscool  阅读(409)  评论(0)    收藏  举报