MySQL event scheduler and how to create MySQL events to automate database tasks
Working with MySQL Scheduled Event SET GLOBAL event_scheduler = OFF; SET GLOBAL event_scheduler = ON; MySQL event scheduler and how to create MySQL events to automate database tasks. A MySQL event is a task that runs based on a predefined schedule therefore sometimes it is referred to as a scheduled event. MySQL event is also known as “temporal trigger” because it is triggered by time, not by table update like a trigger. A MySQL event is similar to a cron job in UNIX or a task scheduler in Windows. You can use MySQL events in many cases such as optimizing database tables, cleaning up logs, archiving data, or generate complex reports during off-peak time. MySQL event scheduler configuration MySQL uses a special thread called event schedule thread to execute all scheduled events. You can see the status of event scheduler thread by executing the following command: SHOW PROCESSLIST; By default, the event scheduler thread is not enabled. To enable and start the event scheduler t...