MySQL Error: Lock wait timeout exceeded?

problem description

specific error message is

General error: 1205 Lock wait timeout exceeded; try restarting transaction

the reason for this problem is that there is a process that has been occupying the lock and does not release it. How do you reproduce this problem? How to solve it?

Nov.01,2021

How to debug Lock wait timeout exceeded on MySQL?


mysql-uxxx-ppass-e "show processlist" | grep-I "locked"

or show engine innodb status

find id kill


build a test table on which update does not submit, and another session will not be reproduced if you go to update.
show processlist finds the session that holds the lock, and just drop kill.

Menu