Mysql ERROR: ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction, hy000restarting
After the index was added last night, Lock wait timeout exceeded was thrown when querying the entire table; try restarting transaction. I am scared to death. Why can't I find the entire table because of the conditional query, the boss said that I added an error ..., later, I found a solution. It turned out to be a deadlock.
View database isolation levels
select @@tx_isolation;
Check the current mysql database process (whether a thread such as wait exists and kill it directly)
show full processlist
Compare the situation in the thread and check whether there are locked transaction threads.
SELECT * FROM information_schema.INNODB_TRX;
Deadlock Removal
KILL XXX
Have you ever encountered this problem, how did you solve it? I have many questions.