当前位置:Gxlcms > PHP教程 > 怎么让mysql每天自动删除和增加一定的记录

怎么让mysql每天自动删除和增加一定的记录

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

怎么让mysql在某个表里每天自动删除和增加一定的记录


回复讨论(解决方案)

每天凌晨三点执行

  create event event_call_defer     on schedule every 1 day starts date_add(date(curdate() + 1),interval 3 hour)  on completion preserve enable  do  begin      delete from tbl_name limit 10  end  

每天凌晨三点执行

  create event event_call_defer     on schedule every 1 day starts date_add(date(curdate() + 1),interval 3 hour)  on completion preserve enable  do  begin      delete from tbl_name limit 10  end  

谢谢

人气教程排行