Welcome to Yumao′s Blog.
我想按照某条件每天凌晨进行数据库清理操作
所以就有了以下内容 嗯嗯
DELIMITER $$ SET GLOBAL event_scheduler = 1 $$ create procedure clear() begin delete from vpnuser where exdate<sysdate(); end $$ create event clear_table on schedule every 1 day starts date_add(date(curdate()+1),interval 1 minute) on completion preserve do call clear(); $$ ALTER EVENT clear_table ON COMPLETION PRESERVE ENABLE;