Mysql try restarting transaction怎么解决,排查事务锁表

查看当前事务trx_mysql_thread_id
select * from information_schema.INNODB_TRX ;

 

 

 

 

 

 执行kill命令杀掉进程

kill 18531

 

其他命令

查看锁行的表和索引

SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS;

 

 

 

 

 

 查看当前等待锁事务

SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS;

 

 

 

 

 

 

更详细参数说明可参考 

https://www.cnblogs.com/agang-php/p/14493461.html

https://blog.csdn.net/java__project/article/details/100137526(推荐这篇)

 

posted @ 2021-03-04 22:48  灰辉-灰  阅读(1762)  评论(0编辑  收藏  举报