当前位置:Gxlcms > mysql > Mysql事件查看及定时器相关操作_MySQL

Mysql事件查看及定时器相关操作_MySQL

时间:2021-07-01 10:21:17 帮助过:146人阅读

bitsCN.com

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)

bitsCN.com

人气教程排行