mysql 存储过程事件定时任务
====存储过程
CREATE DEFINER=`root`@`%` PROCEDURE `delLast6Month`()
BEGIN
DELETE FROM yun_ippbx.acr_vpn WHERE `calllingtime` < DATE_ADD(CURDATE(), INTERVAL -6 MONTH); #删除6个月以前的数据
END
====事件
create event clean_acr_vpn
ON SCHEDULE EVERY 1 DAY STARTS DATE_ADD(DATE_ADD(CURDATE(), INTERVAL 1 DAY), INTERVAL 1 HOUR) #每天凌晨1点执行存储过程
on completion preserve enable
do call delLast6Month();