Querious Docs

Server Events view — MySQL

Every scheduled event on the server, and whether the scheduler is running.

MySQL events are statements run on a schedule. They're easy to forget, and do nothing unless the event scheduler is on. This view lists every event on the server, across all schemas, and shows the scheduler's state above them.

The Events view
The Events view

The Event Scheduler #

At the top of the Events view, Event Scheduler shows the state of event_scheduler and lets you change it.

State Meaning
Enabled The scheduler is running and events fire on schedule.
Disabled The scheduler is off. Every event is inert regardless of its own status.
Disabled on Slave Off because this server is a replica. Events fire on the source and arrive through replication, so running them here would apply them twice.
Disabled in configuration event_scheduler was set to DISABLED at startup. It can't be changed at runtime, only by a configuration change and a restart.

Switching the scheduler needs the SUPER privilege and lasts until the server restarts. Put the setting in my.cnf to make it permanent.

The List #

Column What it shows
Name The event and its schema.
Definer The user the event runs as. Its privileges, not yours, decide what the event can do.
Schedule An interval or a one-off time.
Status Whether the event itself is enabled. An enabled event still does nothing while the scheduler is off.
Last Executed When it last ran. An event that claims to run hourly and last ran in March isn't running.

Recipes #

To work out why an event isn't running

  1. Check the Event Scheduler state. If it's Disabled, that's the answer.
  2. Check the event's own Status, since events can be disabled individually.
  3. Check Last Executed. If it never ran, the schedule may start in the future or have already ended.
  4. Check Definer. If that user was dropped or lost privileges, the event fails every time it fires.
  5. Read the event body by selecting it in the primary sidebar, and check the Error Log for failures.

To audit what a server runs on its own

  1. Read the whole list, which spans every schema.
  2. Sort by Last Executed to separate live events from abandoned ones.
  3. Note any Definer you don't recognize.