MySQL Variables flush_time 数据库 参数变量解释及正确配置使用

本站中文解释

flush_time参数用于控制每次检查日志刷新的最大间隔时间,以秒为单位。它指定了每次检查日志并且可能执行刷新的最长间隔时间。如果未设置 flush_time,MySQL的默认行为是每秒执行一次日志检查。

flush_time参数的默认值为 1800 秒,该值可在 my.cnf 文件中设置或通过终端中的SET GLOBAL 语句设置覆盖默认值

修改 flush_time 的方法如下:

1.从终端运行SET GLOBAL flush_time=(数值);例如
SET GLOBAL flush_time=1800;
2.编辑my.cnf文件,在文件中添加下面一行代码:
flush_time = (数值)
例如:flush_time = 1800
重启MySQL服务即可使更改生效。

官方英文解释

flush_time

Command-Line Format --flush-time=#
System Variable flush_time
Scope Global
Dynamic Yes
Type Integer
Default Value 0
Minimum Value 0
Maximum Value 31536000
Unit seconds

If this is set to a nonzero value, all tables are closed every
flush_time seconds to free up
resources and synchronize unflushed data to disk. This option
is best used only on systems with minimal resources.

Note

If flush is enabled, the
value of flush_time does
not matter and changes to
flush_time have no effect
on flush behavior.


数据运维技术 » MySQL Variables flush_time 数据库 参数变量解释及正确配置使用