MySQL Variables event_scheduler 数据库 参数变量解释及正确配置使用
本站中文解释
event_scheduler是MySQL的一个调度参数,可以激活MySQL的计划任务器服务,用来实现定时任务,如每天定时备份数据库,清理过期的历史数据等等。
具体设置方法:
1.登录MySQL客户端;
2.运行如下命令设置event_scheduler状态:
SET GLOBAL event_scheduler = ON;
3.运行如下命令查看当前状态:
SHOW GLOBAL VARIABLES like ‘event_scheduler’;
4.设置完成后,可以在MySQL中添加计划任务。
官方英文解释
event_scheduler
Command-Line Format | --event-scheduler[=value] |
---|---|
System Variable | event_scheduler |
Scope | Global |
Dynamic | Yes |
Type | Enumeration |
Default Value | OFF |
Valid Values |
|
This variable enables or disables, and starts or stops, the
Event Scheduler. The possible status values are
ON
, OFF
, and
DISABLED
. Turning the Event Scheduler
OFF
is not the same as disabling the Event
Scheduler, which requires setting the status to
DISABLED
. This variable and its effects on
the Event Scheduler’s operation are discussed in greater
detail in Section 23.4.2, “Event Scheduler Configuration”