What Is a Dead Lock in MySQL

Q

What Is a Dead Lock in MySQL?

✍: FYIcenter.com

A

A dead lock is phenomenon happens between two transactions with each of them holding a lock that blocks the other transaction as shown in the following diagram:

(transaction 1)                    (transaction 2)
update row X to create lock 1
                                  update row Y to create lock 2
                                  update row X
                                  (blocked by lock 1)
update row Y
(blocked by lock 2)

(dead lock created)

 

Experiment with Dead Locks in MySQL

Error: Lock Wait Timeout Exceeded in MySQL

Transaction Management: Commit or Rollback in MySQL

⇑⇑ MySQL Database Tutorials

2017-04-28, 1613🔥, 0💬