1205: Lock wait timeout exceeded; try restarting transaction
MySQLWhat does it mean?
A transaction waited for a required row lock for innodb_lock_wait_timeout seconds, could not acquire it and timed out.
Why does it happen?
Another transaction holding the lock for a long time without commit or rollback; idle open transactions, long-running bulk updates or contended hot rows.
How to fix it
Find the blocking transaction: join performance_schema.data_lock_waits with data_locks (information_schema.innodb_lock_waits/innodb_trx in older versions). Commit/roll back the blocking transaction or terminate it with KILL <trx_mysql_thread_id> if necessary. Keep transactions short and do not leave transactions idle (autocommit/application logic). If needed, tune innodb_lock_wait_timeout to the workload.