Getting Lock wait timeout exceeded try restarting transaction even though I m not using a transaction

0 votes

I'm running the following MySQL UPDATE statement:

mysql> update customer set account_import_id = 1; 
ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction

I'm not using a transaction, so why would I be getting this error? I even tried restarting my MySQL server and it didn't help. The table has 406,733 rows.

Feb 18, 2022 in Web Development by Soham
• 9,730 points
• 6,564 views

1 answer to this question.

0 votes

 To answer your question, I have written down some steps which should help you force unlock for the locked tables in MySQL. In order to break the locks which causes an atomicity in the database, but not to enforce on the SQL statements that caused the lock as it is a proper solution to resolve your application causing the locks. That being said, when there are dollars on the line, things will get moving swiftly again. Enter MySQL as mentioned below:- 

mysql -u your_user -p

Following which, let us see the list of locked tables using:-

mysql> show open tables where in_use>0;

Let's see the list of the current processes, one of them is locking your table(s):-
 

mysql> show processlist;

Finally, kill one of these processes:-
 

mysql> kill <put_process_id_here>;

Hope this helps!

Enroll in Web Development Course online to learn more in detail.

Thank You!

answered Feb 18, 2022 by Aditya
• 7,680 points

Related Questions In Web Development

0 votes
0 answers

How can I create a "Please Wait, Loading..." animation using jQuery?

I would like to place a "please ...READ MORE

Aug 11, 2022 in Web Development by gaurav
• 25,250 points
• 1,522 views
0 votes
0 answers

How can I create a "Please Wait, Loading..." animation using jQuery?

I would like to place a "please ...READ MORE

Aug 12, 2022 in Web Development by gaurav
• 25,250 points
• 1,836 views
0 votes
0 answers

Getting the Text of a Check Box and Text Area To Display using jQuery

What I am trying to do is ...READ MORE

Aug 18, 2022 in Web Development by gaurav
• 25,250 points
• 3,173 views
0 votes
2 answers

I'm getting the error;;net::ERR_CONNECTION_REFUSED

Hello @ sodash, Try to edit .env APP_URL to your ...READ MORE

answered Aug 24, 2020 in Web Development by Niroj
• 82,800 points
• 18,517 views
0 votes
1 answer