The length of time a transaction waits for a resource, before
giving up and rolling back the statement, is determined by the
value of the configuration parameter
MySQL 5.0.12 and earlier, the entire transaction was rolled
back, not just the statement.) Your application can try the
statement again (usually after waiting for a while), or roll
back the entire transaction and restart.
The error returned when the timeout period is exceeded is:
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
In MySQL 5.5 and higher, the configuration parameter
innodb_lock_wait_timeout can be
set at runtime with the
SET GLOBAL or
SET SESSION statement. Changing the
GLOBAL setting requires the
SUPER privilege and affects the operation of
all clients that subsequently connect. Any client can change the
SESSION setting for
affects only that client.
In MySQL 5.1 and earlier, the only way to set this parameter was
in the MySQL
my.ini), and changing it required shutting
down and restarting the server.