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
• 8,730 points
823 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,280 points

Related Questions In Web Development

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,720 points
5,517 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,850 points
56,175 views
0 votes
0 answers

TypeError: this.client.incrementMaxListeners is not a function

I'm making a command for my discord ...READ MORE

Dec 29, 2020 in Web Development by anonymous
• 120 points
299 views
0 votes
1 answer

How can I create a simple page vertical scroll bar without using jQuery?

Surprisingly, there is not a great, simple ...READ MORE

answered Jun 22 in Web Development by rajatha
• 5,040 points
6 views
0 votes
1 answer

Adding a page loader using jQuery

“html loader using jquery” Code Answer $('body'). append('<div ...READ MORE

answered Jun 27 in Web Development by rajatha
• 5,040 points
4 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,850 points
341 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
42 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,560 points
384 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,280 points
17 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP