MySQL Variables tx_read_only 数据库 参数变量解释及正确配置使用
本站中文解释
MySQL 变量”tx_read_only”的功能是用来管理MySQL是否能够进行事务处理的。即设置 MySQL 实例能够处理的类型,是只读取(不能进行更新操作),还是可进行写入更新操作(可以进行更新操作)。
用来设置 MySQL 参数变量”tx_read_only”的语句是:
SET GLOBAL tx_read_only = {0 | 1};
其中,0 表示 MySql 允许进行更新操作,1 表示 MySql 以只读方式进行操作。
官方英文解释
tx_read_only
Deprecated | 5.7.20 |
---|---|
System Variable | tx_read_only |
Scope | Global, Session |
Dynamic | Yes |
Type | Boolean |
Default Value | OFF |
The default transaction access mode. The value can be
OFF
(read/write, the default) or
ON
(read only).
transaction_read_only
was
added in MySQL 5.7.20 as a synonym for
tx_read_only
, which is now
deprecated and is removed in MySQL 8.0.
Applications should be adjusted to use
transaction_read_only
in
preference to tx_read_only
.
See the description of
transaction_read_only
for
details.