Events Overview
An introduction to creating and managing scheduled events, which are named database objects containing SQL statements to be executed by the Event Scheduler.
Creating Events
Example
CREATE EVENT test_event
ON SCHEDULE EVERY 1 MINUTE DO
UPDATE test.t1 SET a = a + 1;Executing Events
SHOW PROCESSLIST;
+----+-----------------+-----------+------+---------+------+-----------------------------+------------------+----------+
| Id | User | Host | db | Command | Time | State | Info | Progress |
+----+-----------------+-----------+------+---------+------+-----------------------------+------------------+----------+
| 40 | root | localhost | test | Sleep | 4687 | | NULL | 0.000 |
| 41 | root | localhost | test | Query | 0 | init | SHOW PROCESSLIST | 0.000 |
| 42 | event_scheduler | localhost | NULL | Daemon | 30 | Waiting for next activation | NULL | 0.000 |
+----+-----------------+-----------+------+---------+------+-----------------------------+------------------+----------+Viewing Current Events
Example
Altering Events
Example
Dropping Events
Example
See Also
Last updated
Was this helpful?

