MySQL Variables lock_wait_timeout 数据库 参数变量解释及正确配置使用
2023-06-13 09:11:25 时间
本站中文解释
This variable specifies the timeout in seconds for attempts to
acquire metadata locks. The permissible values range from 1 to
31536000 (1 year). The default is 31536000. This timeout applies to all statements that use metadata
locks. These include DML and DDL operations on tables, views,
stored procedures, and stored functions, as well as
LOCK TABLES,
FLUSH TABLES WITH READ LOCK,
and HANDLER statements. This timeout does not apply to implicit accesses to system
tables in the mysql database, such as grant
tables modified by GRANT or
REVOKE statements or table
logging statements. The timeout does apply to system tables
accessed directly, such as with
SELECT or
UPDATE. The timeout value applies separately for each metadata lock
attempt. A given statement can require more than one lock, so
it is possible for the statement to block for longer than the
lock_wait_timeout value
before reporting a timeout error. When lock timeout occurs,
ER_LOCK_WAIT_TIMEOUT is
reported. lock_wait_timeout does not
apply to delayed inserts, which always execute with a timeout
of 1 year. This is done to avoid unnecessary timeouts because
a session that issues a delayed insert receives no
notification of delayed insert timeouts.
我想要获取技术服务或软件
服务范围:MySQL、ORACLE、SQLSERVER、MongoDB、PostgreSQL 、程序问题
服务方式:远程服务、电话支持、现场服务,沟通指定方式服务
技术标签:数据恢复、安装配置、数据迁移、集群容灾、异常处理、其它问题
本站部分文章参考或来源于网络,如有侵权请联系站长。
数据库远程运维 MySQL Variables lock_wait_timeout 数据库 参数变量解释及正确配置使用
lock_wait_timeout 是MySQL的一个全局系统变量,它用来决定MySQL超时时间,即让MySQL等待获取表锁的最大时间。
此参数的设置优先级从高到低从下列顺序::
1. 会话级别: SET SESSION lock_wait_timeout = xxx;
2. 全局级别: 通过 SET GLOBAL lock_wait_timeout = xxx;
3. 启动参数: lock-wait-timeout=xxx
4. 默认值: lock_wait_timeout = 31536000
如果指定值小于等于 0, 则MySQL会持续等待, 直到拿到表锁或者调用kill.如果MySQL等待超时,则会出现LOCK WAIT TIMEOUT错误。
设置 lock_wait_timeout 时, 需要注意控制这个值相关的性能参数, 否则可能引发性能问题。
官方英文解释 lock_wait_timeoutThis variable specifies the timeout in seconds for attempts to
acquire metadata locks. The permissible values range from 1 to
31536000 (1 year). The default is 31536000. This timeout applies to all statements that use metadata
locks. These include DML and DDL operations on tables, views,
stored procedures, and stored functions, as well as
LOCK TABLES,
FLUSH TABLES WITH READ LOCK,
and HANDLER statements. This timeout does not apply to implicit accesses to system
tables in the mysql database, such as grant
tables modified by GRANT or
REVOKE statements or table
logging statements. The timeout does apply to system tables
accessed directly, such as with
SELECT or
UPDATE. The timeout value applies separately for each metadata lock
attempt. A given statement can require more than one lock, so
it is possible for the statement to block for longer than the
lock_wait_timeout value
before reporting a timeout error. When lock timeout occurs,
ER_LOCK_WAIT_TIMEOUT is
reported. lock_wait_timeout does not
apply to delayed inserts, which always execute with a timeout
of 1 year. This is done to avoid unnecessary timeouts because
a session that issues a delayed insert receives no
notification of delayed insert timeouts.
我想要获取技术服务或软件
服务范围:MySQL、ORACLE、SQLSERVER、MongoDB、PostgreSQL 、程序问题
服务方式:远程服务、电话支持、现场服务,沟通指定方式服务
技术标签:数据恢复、安装配置、数据迁移、集群容灾、异常处理、其它问题
本站部分文章参考或来源于网络,如有侵权请联系站长。
数据库远程运维 MySQL Variables lock_wait_timeout 数据库 参数变量解释及正确配置使用
相关文章
- MySQL最佳下载版本指南(mysql要下载哪个版本)
- MySQL实现限制登录次数的方法(mysql限制登录次数)
- MySQL:全面解决数据库管理问题(mysql程序包)
- MySQL:掌握左右连接的技巧(mysql左连接右连接)
- MySQL数据库:强大的功能提升数据处理能力(mysql数据库的功能)
- 数据库架设手机MySQL数据库:解决方案(手机mysql)
- 从MySQL数据库到新行:架构改变你的事业(mysql数据库换行)
- MySQL数据库的检查与维护(mysql数据检查)
- MySQL数据库实现加锁机制(mysql数据加锁)
- MySQL插入操作的并发性研究(mysql插入并发)
- MySQL页级锁:保障数据库性能与安全(mysql页级锁)
- MySQL数据库面试题解析(mysql数据库面试题)
- 「MySQL 递归调用」概念、实现及优化(mysql递归调用)
- 编程MySQL编程实现C语言功能强大化(c使用mysql)
- MySQL如何显示所有用户?(mysql显示所有用户)
- ?MySQL数据库如何快速创建?(mysql数据库怎么创建)
- MySQL数据库CI框架中的重连处理(ci mysql重连)
- 从sql中刷新MySQL数据库(.sql刷mysql)
- 快速学习如何使用MySQL函数取两者最小值(mysql两者取最小)
- MySQL在线下载轻松获取数据库管理工具(mysql下载在线)