MySQL's event scheduler is a built-in cron: it runs SQL on a schedule without any external tooling. Nightly summary tables, log cleanup, and data refreshes can all live inside the database itself.
Key Points
- Enable it: SET GLOBAL event_scheduler = ON;
- CREATE EVENT nightly_agg ON SCHEDULE EVERY 1 DAY STARTS '2026-07-15 02:00:00' DO CALL build_summary();
- One-time events: ON SCHEDULE AT TIMESTAMP
- Inspect with SHOW EVENTS; alter or drop like other objects
- Great for refreshing reporting tables before business hours
- For complex pipelines, external orchestrators (Airflow, cron) offer more control
.png)