标签:cond trunc details article aml ble https tail 重启
1.设置开启event scheduler
SET GLOBAL event_scheduler=1;
2.验证event_scheduler是否已经开启
3.创建event
DROP EVENT IF EXISTS e_delete_upvote;
CREATE EVENT e_delete_upvote
ON SCHEDULE EVERY 1 day STARTS DATE_ADD(current_date(),INTERVAL 1 DAY) ON COMPLETION PRESERVE ENABLE
DO
TRUNCATE TABLE dreamland.upvote;
#说明: ON SCHEDULE EVERY 1 day 指定循环间隔为每天执行
STARTS date_add(concat(current_date(), ‘ 23:59:00‘), interval 0 second)
指定运行时间为23:59:00 ON COMPLETION PRESERVE ENABLE 指定创建完成后即启用,否则需手动启动
4.手动关闭事件
ALTER EVENT e_delete_upvote DISABLE;
5.手动该事件为可用
ALTER EVENT e_delete_upvote ENABLE;
6.查看已有的定时事件任务
SHOW EVENTS;
7.删除事件
DROP EVENT e_delete_upvote;
--------------------- 本文来自 坏菠萝 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/abcwanglinyong/article/details/79986023?utm_source=copy
标签:cond trunc details article aml ble https tail 重启
原文地址:https://www.cnblogs.com/xiaoliu66007/p/9709149.html