简体   繁体   English

变量“ innodb_lock_wait_timeout”是只读变量

[英]Variable 'innodb_lock_wait_timeout' is a read only variable

I want to change innodb_lock_wait_timeout MySQL variable. 我想更改innodb_lock_wait_timeout MySQL变量。 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 错误1238(HY000):变量'innodb_lock_wait_timeout'是只读变量

Default @@innodb_lock_wait_timeout is 50 but I want to change it to 900. 默认@@ innodb_lock_wait_timeout为50,但我想将其更改为900。

How can I do this? 我怎样才能做到这一点?

innodb_lock_wait_timeout can be set at runtime with the SET GLOBAL or SET SESSION statement. 可以在运行时使用SET GLOBAL或SET SESSION语句设置innodb_lock_wait_timeout。 Changing the GLOBAL setting requires the SUPER privilege and affects the operation of all clients that subsequently connect. 更改GLOBAL设置需要SUPER特权,并影响随后连接的所有客户端的操作。 Any client can change the SESSION setting for innodb_lock_wait_timeout, which affects only that client. 任何客户端都可以更改innodb_lock_wait_timeout的SESSION设置,这仅影响该客户端。

You may also change the config file my.cnf and add innodb_lock_wait_timeout=900. 您也可以更改配置文件my.cnf并添加innodb_lock_wait_timeout = 900。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM