MySQL Error 1213 – ER_LOCK_DEADLOCK

MySQL Error Message

Deadlock found when trying to get lock; try restarting
transaction

Reason for the Error

InnoDB reports this error when a
transaction encounters a
deadlock and is automatically
rolled back so that your
application can take corrective action. To recover from this
error, run all the operations in this transaction again. A
deadlock occurs when requests for locks arrive in inconsistent
order between transactions. The transaction that was rolled back
released all its locks, and the other transaction can now get all
the locks it requested. Thus, when you re-run the transaction that
was rolled back, it might have to wait for other transactions to
complete, but typically the deadlock does not recur. If you
encounter frequent deadlocks, make the sequence of locking
operations (LOCK TABLES, SELECT …
FOR UPDATE, and so on) consistent between the different
transactions or applications that experience the issue. See
Deadlocks in InnoDB for details.

Share:

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

MySQL Error Message Could not read CA key file: %s Reason for the Error ER_X509_CANT_READ_CA_KEY was added in 8.0.2.
MySQL Error Message Read invalid event from master: ‘%s’, master could be corrupt but a more likely cause of this...
MySQL Error Message %s Reason for the Error ER_IB_MSG_315 was added in 8.0.11.