Mysql 事件

查看事件

SHOW EVENTS

select * from mysql.event

查看是否开启定时器
SHOW VARIABLES LIKE 'event_scheduler';

开启定时器 0:off 1:on
SET GLOBAL event_scheduler = 1; .

删除

drop  EVENT *_event;

创建

CREATE EVENT IF NOT EXISTS *_event_test
ON SCHEDULE  every 1 Hour
DO CALL update_*_proc(); 

或者

CREATE EVENT IF NOT EXISTS update_*_event
ON SCHEDULE  every 1 DAY STARTS TIMESTAMP(CURRENT_DATE,'00:05:00')
ON COMPLETION PRESERVE ENABLE
DO CALL update_*_proc(); 

 

date_add(date(curdate() + 1),interval 8 hour) 

 

 

你可能感兴趣的:(mysql)