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,700 points
4,518 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
• 23,260 points
227 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
• 23,260 points
533 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
• 23,260 points
1,451 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,880 points
13,268 views
0 votes
1 answer

Error: Failed to load resource: the server responded with a status of 404 (Not Found)

Your files are not under the JSP folder that's ...READ MORE

answered Dec 16, 2020 in Web Development by Gitika
• 65,910 points
86,622 views
0 votes
1 answer
0 votes
1 answer

How to change the default value and to alter a column in sql?

Hi, You can try this: ALTER TABLE foobar_data CHANGE ...READ MORE

answered Jun 24, 2019 in Big Data Hadoop by Gitika
• 65,910 points
1,152 views
0 votes
1 answer

What is an index in SQL?

An index is used to speed up ...READ MORE

answered Feb 3, 2022 in Database by Vaani
• 7,020 points
388 views
0 votes
1 answer

Ordering by the order of values in a SQL IN() clause

Use MySQL's FIELD() function: SELECT name, description, ... FROM ... WHERE id ...READ MORE

answered Feb 4, 2022 in Database by Neha
• 9,060 points
4,207 views
0 votes
1 answer

How do write IF ELSE statement in a MySQL query

You probably want to use a CASE ...READ MORE

answered Feb 18, 2022 in Web Development by Aditya
• 7,680 points
371 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP