问题描述
1.我有一个脚本,可以执行一些更新/删除操作
1.I have a script, that executes some update/delete operations
2.所有sql操作都在事务(InnoDb表)内执行
2.All sql operations are executed inside transaction(InnoDb tables)
3.有时我会收到尝试获取锁时发现死锁;尝试重新启动事务"
3.From time to time I get "Deadlock found when trying to get lock; try restarting transaction"
此应用程序中还有其他一些作业,它们执行数据库操作.我的问题是查找来自其他脚本的哪些并发查询会干扰我的脚本.找到它们的最简单方法是什么?
There are some other jobs in this application, that perform database operations. My problem is to find which concurrent queries from other scripts interfere my script. What is the easiest way to find them?
推荐答案
还没有尝试过,但是如何找出谁在MySQL中锁定表似乎是合理的.
Haven't tried it but How to find out who is locking a table in MySQL seems to be reasonable.
本文是有关如何使用innotop MySQL和InnoDB监视器的系列文章中的第二篇.
This article is the second in a series on how to use the innotop MySQL and InnoDB monitor.
这篇关于查找mysql死锁的原因的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!