查找mysql死锁的原因 [英] find mysql deadlock reasons

查看:96
本文介绍了查找mysql死锁的原因的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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?

推荐答案

还没有尝试过,但是

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.

本文是有关如何使用innotop MySQL和InnoDB监视器的系列文章中的第二篇.

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

这篇关于查找mysql死锁的原因的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆