MySQL Variables transaction_isolation 数据库 参数变量解释及正确配置使用
2023-06-13 09:11:26 时间
本站中文解释
The transaction isolation level has three scopes: global,
session, and next transaction. This three-scope implementation
leads to some nonstandard isolation-level assignment
semantics, as described later. To set the global transaction isolation level at startup, use
the --transaction-isolation
server option. At runtime, the isolation level can be set directly using the
SET
statement to assign a value to the
transaction_isolation system
variable, or indirectly using the SET
TRANSACTION statement. If you set
transaction_isolation
directly to an isolation level name that contains a space, the
name should be enclosed within quotation marks, with the space
replaced by a dash. For example, use this
SET
statement to set the global value:
transaction_isolation value
sets the isolation level for all subsequent sessions. Existing
sessions are unaffected. To set the session or next-level
transaction_isolation value,
use the
SET
statement. For most session system variables, these statements
are equivalent ways to set the value:
next-transaction scope, in addition to the global and session
scopes. To enable the next-transaction scope to be set,
SET
syntax for assigning session system variable values has
nonstandard semantics for
transaction_isolation:
Sets the isolation level for all subsequent
transactions performed within the session.
Permitted within transactions, but does not affect the
current ongoing transaction.
If executed between transactions, overrides any
preceding statement that sets the next-transaction
isolation level.
Sets the isolation level only for the next single
transaction performed within the session.
transaction_isolation system
variable, see Section 13.3.6, “SET TRANSACTION Statement”. transaction_isolation was
added in MySQL 5.7.20 as a synonym for
tx_isolation, which is now
deprecated and is removed in MySQL 8.0.
Applications should be adjusted to use
transaction_isolation in
preference to tx_isolation.
我想要获取技术服务或软件
服务范围:MySQL、ORACLE、SQLSERVER、MongoDB、PostgreSQL 、程序问题
服务方式:远程服务、电话支持、现场服务,沟通指定方式服务
技术标签:数据恢复、安装配置、数据迁移、集群容灾、异常处理、其它问题
本站部分文章参考或来源于网络,如有侵权请联系站长。
数据库远程运维 MySQL Variables transaction_isolation 数据库 参数变量解释及正确配置使用
transaction_isolation 参数用于控制mysql事务的隔离级别。这个参数控制 MySQL 事务的隔离级别,因为可以为并发事务防止丢失修改或脏读。Transaction_isolation 有四种可选的分离级别:读未提交(READ UNCOMMITTED)、读提交(READ COMMITTED)、可重复读(REPEATABLE READ)和串行化(SERIALIZABLE)。
要设置 transaction_isolation,可以在 my.cnf 文件中直接设置:
# 默认情况下,mysql 使用 REPEATABLE-READ
transaction-isolation=REPEATABLE-READ
也可以通过执行SQL语句在会话级别设置:
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
官方英文解释 transaction_isolationThe transaction isolation level has three scopes: global,
session, and next transaction. This three-scope implementation
leads to some nonstandard isolation-level assignment
semantics, as described later. To set the global transaction isolation level at startup, use
the --transaction-isolation
server option. At runtime, the isolation level can be set directly using the
SET
statement to assign a value to the
transaction_isolation system
variable, or indirectly using the SET
TRANSACTION statement. If you set
transaction_isolation
directly to an isolation level name that contains a space, the
name should be enclosed within quotation marks, with the space
replaced by a dash. For example, use this
SET
statement to set the global value:
SET GLOBAL transaction_isolation = "READ-COMMITTED";Setting the global
transaction_isolation value
sets the isolation level for all subsequent sessions. Existing
sessions are unaffected. To set the session or next-level
transaction_isolation value,
use the
SET
statement. For most session system variables, these statements
are equivalent ways to set the value:
SET @@SESSION.var_name = value; SET SESSION var_name = value; SET var_name = value; SET @@var_name = value;As mentioned previously, the transaction isolation level has a
next-transaction scope, in addition to the global and session
scopes. To enable the next-transaction scope to be set,
SET
syntax for assigning session system variable values has
nonstandard semantics for
transaction_isolation:
SET @@SESSION.transaction_isolation = value; SET SESSION transaction_isolation = value; SET transaction_isolation = value;For each of those syntaxes, these semantics apply:
Sets the isolation level for all subsequent
transactions performed within the session.
Permitted within transactions, but does not affect the
current ongoing transaction.
If executed between transactions, overrides any
preceding statement that sets the next-transaction
isolation level.
Sets the isolation level only for the next single
transaction performed within the session.
transaction_isolation system
variable, see Section 13.3.6, “SET TRANSACTION Statement”. transaction_isolation was
added in MySQL 5.7.20 as a synonym for
tx_isolation, which is now
deprecated and is removed in MySQL 8.0.
Applications should be adjusted to use
transaction_isolation in
preference to tx_isolation.
我想要获取技术服务或软件
服务范围:MySQL、ORACLE、SQLSERVER、MongoDB、PostgreSQL 、程序问题
服务方式:远程服务、电话支持、现场服务,沟通指定方式服务
技术标签:数据恢复、安装配置、数据迁移、集群容灾、异常处理、其它问题
本站部分文章参考或来源于网络,如有侵权请联系站长。
数据库远程运维 MySQL Variables transaction_isolation 数据库 参数变量解释及正确配置使用
相关文章
- 解决服务器连接错误Host ‘XXX’ is not allowed to connect to this MySQL server详解数据库
- MySQL Variables version_compile_os 数据库 参数变量解释及正确配置使用
- MySQL连接日志:跟踪系统性能和安全(mysql连接日志)
- MySQL命令指南:刷新数据库(mysql刷新命令)
- 如何查看MySQL中的权限设置(查看mysql的权限)
- 开发MySQL数据库支持移动开发实现智能化管理(mysql数据库移动)
- MySQL创建数据库用户:步骤指南(mysql创建数据库用户)
- MySQL添加系统服务: 实现快速部署(mysql添加系统服务)
- 管理MySQL管理大型数据库的方法与技巧(mysql大型数据库)
- 数据库MySQL数据库之王竹峰的成功之旅(王竹峰mysql)
- 深入理解MySQL导出Database数据(mysql导出数据库数据)
- MySQL窗口:操作MySQL数据库的必备工具(mysql窗口)
- MySQL数据库中如何使用锁表控制访问?(锁表mysql)
- 实施MySQL集群:从安装到配置(mysql集群安装配置)
- MySQL数据库如何设置只读权限(mysql只读)
- 「MySQL经验分享——我对MySQL的一些见解」(mysql心得)
- MySQL数据库导出: 入门操作语法简介(mysql数据库导出语句)
- 解码MySQL:探索数据库之旅(decode mysql)
- MySQL中的std函数用于计算标准差(mysql中std函数)
- MySQL中用split方法实现字符串拆分(mysql中spit方法)
- 解决24个MySQL索引问题,找到更高效的数据库操作(24个mysql索引问题)
- MySQL三表查询筛选技巧分享(mysql 三表 筛选)
- 解读mysql执行信息,优化数据库性能(mysql_ 执行的信息)
- MySQL安装教程轻松配置下午需要的数据库系统(mysql下午安装教程)