Saturday, January 5, 2013

MySQL: Fix error "Lock wait timeout exceeded; try restarting transaction"

MySQL error message: "Lock wait timeout exceeded; try restarting transaction"
MySQL error code: 1205

The MySQL variable innodb_lock_wait_timeout specifies the lock timeout in seconds.

See the current value of innodb_lock_wait_timeout:
SHOW VARIABLES LIKE 'innodb_lock_wait_timeout';

For MySQL versions greater than 5.5: use SET GLOBAL or SET SESSION syntax to change the value of innodb_lock_wait_timeout at runtime.

For all MySQL versions and earlier versions set this value in my.cnf:
# example:
innodb_lock_wait_timeout=120

No comments: