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 in Web Development by Soham
• 9,670 points
2,496 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 by Aditya
• 7,660 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 in Web Development by gaurav
• 22,040 points
64 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 in Web Development by gaurav
• 22,040 points
88 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 in Web Development by gaurav
• 22,040 points
603 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
7,769 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,890 points
69,441 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,890 points
544 views
0 votes
1 answer

What is an index in SQL?

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

answered Feb 3 in Database by Vaani
• 7,020 points
115 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 in Database by Neha
• 8,940 points
1,533 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 in Web Development by Aditya
• 7,660 points
62 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