mysql event 设置

阅读更多

mysql定时任务

 

--查看mysql event是否开启

select @@event_scheduler;

 

--命令开启event

SET GLOBAL event_scheduler = ON;

 

--命令关闭event

SET GLOBAL event_scheduler = OFF;

 

--随服务启动event

修改my.cnf

[mysqld]

event_scheduler=ON

 

 

 

--创建event定时任务

create event e_createTask

on schedule every 1 day

starts "2014-10-24 15:19:00"

on completion preserve

do call proc_createTask();

 

--删除event

drop event if exists e_test;

 

--设置event不可用

alter event e_test on completion reesepve disable;

你可能感兴趣的:(mysql,event)