How to Detect Deadlocks
MySQL logs deadlock information internally. To view the most recent deadlock:
Syntax:
SHOW ENGINE INNODB STATUS;
This command returns a detailed report including:
- The conflicting transactions
- The SQL statements involved
- The lock types and affected rows