Posts

Showing posts from February, 2019

Getting “Lock wait timeout exceeded; try restarting transaction” even though I'm not using a transaction

https://stackoverflow.com/questions/5836623/getting-lock-wait-timeout-exceeded-try-restarting-transaction-even-though-im When you are using a transaction, autocommit makes them automatically commit at the end of the statement rather than disabling them. What's actually going on is, since you are updating every record on the table, another thread is holding record lock  on some record taking long time. Thus your thread is being timed out. Further details of the incident can be checked out by running SHOW ENGINE INNODB STATUS after the event (in sql editor). A quiet test machine will be preferable for the procedure.

Rollback one migration

php artisan migrate:rollback --step=1