Solved

how to avoid Lock wait timeout exceeded

Posted on 2011-03-07
2
1,069 Views
Last Modified: 2012-05-11
I executed the following command which generated the error:
ERROR 1205 (HY000) at line 1: Lock wait timeout exceeded; try restarting transaction

ALTER TABLE mainDB.comment ADD FOREIGN KEY (hcId) REFERENCES mainDB.cycle (hcId);"

How to overcome this error?
0
Comment
Question by:pvinodp
2 Comments
 
LVL 20

Accepted Solution

by:
Muhammad Wasif earned 500 total points
ID: 35081290
Sometimes restarting MySQL server resolves the issue. Also look at http://harrison-fisk.blogspot.com/2009/01/xa-and-persistent-innodb-locks.html
0
 

Author Closing Comment

by:pvinodp
ID: 35163219
This worked but seems that the solution is just a hack...

Thanks  anyways
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question