Mysql 事件event_scheduler是OFF

时间:2022-04-25 15:17:57

1 在查询窗口执行:

  SHOW VARIABLES LIKE 'event_scheduler'

查看是OFF 还是ON;

方式1:

修改.int配置文件 添加一行: event_scheduler = 1

Mysql 事件event_scheduler是OFF

cmd- > services.msc找到Mysql 重启服务就OK了

方式2:

开启 Event Scheduler,以下4种方式等效
SET GLOBAL event_scheduler = ON;
SET @@global.event_scheduler = ON;
SET GLOBAL event_scheduler = 1;
SET @@global.event_scheduler = 1;

关闭 Event Scheduler,以下4种方式等效
SET GLOBAL event_scheduler = OFF;
SET @@global.event_scheduler = OFF;
SET GLOBAL event_scheduler = 0;
SET @@global.event_scheduler = 0;