Variable 'innodb_lock_wait_timeout' is a read only variable

3.3k views Asked by At

I want to change innodb_lock_wait_timeout MySQL variable. I tried using this command

set innodb_lock_wait_timeout=900;

but when I ran this I got the following error:

ERROR 1238 (HY000): Variable 'innodb_lock_wait_timeout' is a read only variable

Default @@innodb_lock_wait_timeout is 50 but I want to change it to 900.

How can I do this?

1

There are 1 answers

1
Saloni Uppal On BEST ANSWER

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 innodb_lock_wait_timeout, which affects only that client.

You may also change the config file my.cnf and add innodb_lock_wait_timeout=900.