find mysql deadlock reasons

萝らか妹 提交于 2021-02-05 07:13:27

问题


1.I have a script, that executes some update/delete operations

2.All sql operations are executed inside transaction(InnoDb tables)

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?


回答1:


Haven't tried it but How to find out who is locking a table in MySQL seems to be reasonable.

[...] it is possible, to a limited extent, to find out who’s locking resources. In this article I’ll explain how you can do that.

This article is the second in a series on how to use the innotop MySQL and InnoDB monitor.



来源:https://stackoverflow.com/questions/3501010/find-mysql-deadlock-reasons

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!