Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We've been seeing some deadlocks occur but have not been able to reproduce. Is there any way to determine, after the fact, what queries were running, etc to figure out why deadlock occurred?

share|improve this question
up vote 5 down vote accepted

SHOW INNODB STATUS will give you the last detected deadlock.

share|improve this answer
Much more concise answer !!! – RolandoMySQLDBA Mar 14 '11 at 17:21
awesome, thanks! – statichippo Mar 14 '11 at 17:23
FYI, "SHOW INNODB STATUS" is deprecated. Instead, use "SHOW ENGINE INNODB STATUS" as of MySQL 5.x – randy melder Mar 17 '11 at 1:14

I found this link in about deadlocks. In, user @Omry addressed how to avoid deadlocks and why they happen March 11, 2010 at 9:48 AM. User @ewernli adresssed this as well.

This involves the queries that access the same set of tables in different order from one query to the next.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.