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.
None of the suggested solutions worked for me but this did.
Something is blocking the execution of the query. Most likely another query updating, inserting or deleting from one of the tables in your query. You have to find out what that is:
Once you locate the blocking process, find it's
id
and run :Re-run your initial query.
In my instance, I was running an abnormal query to fix data. If you lock the tables in your query, then you won't have to deal with the Lock timeout:
This is probably not a good idea for normal use.
For more info see: MySQL 8.0 Reference Manual