I have got the error Lock wait timeout exceeded; try restarting transaction
. What are the reasons for this and how to solve the problem? FYI: innodb_lock_wait_timeout = 100
in MySQL config file.
相关问题
- sqlyog export query result as csv
- NOT DISTINCT query in mySQL
- MySQL: conduct a basic search
- Why sometimes there is one of more gap(s) in the v
- mySQL alter table on update, current timestamp
Is this happening on a high-trafficked system where transactions take a long time (i.e. tables are locked for a long time)? If so, you might want to look into your transaction code to make them shorter / more granular / more performant.
This is problem of lock contention, which ultimately result in a time-out on one of the lock. Here are a few suggestions:
insert
orupdate
, some database lock the whole referenced table if there is no such index (don't know if this is the case of MySQL)