設定mysql 事務鎖超時時間 innodb_lock_wait_timeout

yy418408247發表於2019-08-07


Mysql資料庫採用InnoDB模式,預設引數:innodb_lock_wait_timeout設定鎖等待的時間是50s,一旦資料庫鎖超過這個時間就會報錯。


mysql> SHOW GLOBAL VARIABLES LIKE 'innodb_lock_wait_timeout';

+--------------------------+-------+

| Variable_name | Value |

+--------------------------+-------+

| innodb_lock_wait_timeout | 50 |

+--------------------------+-------+

1 row in set (0.00 sec)


mysql> SET GLOBAL innodb_lock_wait_timeout=120;

Query OK, 0 rows affected (0.00 sec)


mysql> SHOW GLOBAL VARIABLES LIKE 'innodb_lock_wait_timeout';

+--------------------------+-------+

| Variable_name | Value |

+--------------------------+-------+

| innodb_lock_wait_timeout | 120 |

+--------------------------+-------+

1 row in set (0.00 sec)


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29494175/viewspace-2652920/,如需轉載,請註明出處,否則將追究法律責任。

相關文章