Saturday, May 14, 2016

innodb_lock_wait_timeout increase timeout

To explain GLOBAL vs SESSION for VARIABLES: The GLOBAL value is used to initialize the SESSION value when your connection starts. After that, you can change the SESSION value to affect what you are doing. And changing the GLOBAL value has no effect on your current connection.

SET GLOBAL innodb_lock_wait_timeout = 10;
SELECT @@innodb_lock_wait_timeout;

SET SESSION innodb_lock_wait_timeout = 10;
SELECT @@innodb_lock_wait_timeout;

SHOW VARIABLES WHERE Variable_name REGEXP 'lock_wait';

Reference:

http://stackoverflow.com/questions/28735473/innodb-lock-wait-timeout-increase-timeout

No comments: