Using the Event Scheduler: The Friendly Behind-the-Scenes Helper

Architecture and Technology, Security and Database Administration
Location: Ballroom D Level: Intermediate
Average rating: ****.
(4.00, 1 rating)

The Event Scheduler is a framework for executing SQL commands at specific times or at regular intervals.
The basics of its architecture are simple. An event is a stored routine with a starting date and time, and a recurring tag. Once defined and activated, it will run when requested. Unlike triggers, events are not linked to specific table operations, but to dates and times.
Using the event scheduler, the database administrator can perform recurring events with minimal hassle. Common occurrence are the cleanup of obsolete data, the creation of summary tables for statistics, the monitoring of server performance and usage.
This session will show how to create events, and how to deal with their limitations and tricky points.
Examples shown during this session include the normal ones, and some hacks, like executing external commands with the event scheduler, monitoring replication servers, executing parallel queries.

Photo of Giuseppe Maxia

Giuseppe Maxia


Giuseppe Maxia is the MySQL community team lead.

A system analyst with 20 years of IT experience, he has worked as a database consultant and designer for several years.

He is a frequent speaker at open source events and the author of many articles.

He lives in Sardinia (Italy).

Photo of Andrey Hristov

Andrey Hristov

SUN Microsystems

I was born in Sofia, Bulgaria in 1980. I graduated both at Technical University-Sofia, Bulgaria with MSc in Computer Engineering, and University of Applied Sciences Stuttgart, Germany with MSc in Software Technology.

I started programming at age of 12, playing with Pascal. My professional carreer started when I was 20. I started at a Web 1.0 oriented company doing development using PHP/MySQL, and later C.

I joined MySQL AB in 2005 after I did my master thesis, Temporal Triggers for MySQL, during my internship at MySQL. I have been involved in QA, Event scheduler implementation (my thesis) which will be available in 5.1, Server bug-fixing and since 2 years part of the connectors team.

Comments on this page are now closed.


Picture of Sheeri K. Cabral
Sheeri K. Cabral
07/29/2009 6:40am PDT

The video is now on YouTube for much easier viewing:

Picture of Sheeri K. Cabral
Sheeri K. Cabral
07/06/2009 10:14am PDT

Download the 145 Mb .mov file at or, if you are more patient, wait (15-20 min) for the streaming to occur at

Picture of Giuseppe Maxia
05/01/2009 1:05am PDT

Kevin, I don’t know what you mean by the “online help”. The manual definitely knows about CREATE EVENT and if you type “help create event” in the command line client, you get the syntax you need.

Kevin Dooley
04/30/2009 9:57pm PDT

Well, I was wrong about that. While the docs say 5.1.6, and the 5.1.34 online help doesn’t know about CREATE EVENT, it does work in 5.1.34. Very confusing…

Kevin Dooley
04/30/2009 9:01pm PDT

It was a great presentation which gave me many ideas about how I could usefully employ events on my applications, but the event scheduler is (according to the 5.1 documentation) not available until release 5.1.6. The current production (GA) release is 5.1.34, which definitely doesn’t include the event scheduler.

Co-presented By:

O'Reilly Media MySQL/Sun Microsystems
  • Kickfire
  • Virident
  • Infobright, Inc
  • JasperSoft
  • Intel
  • Advanced Micro Devices
  • BIRT Exchange by Actuate
  • Calpont
  • Canonical
  • Continuent
  • Dolphin Interconnect Solutions
  • Facebook
  • HiT Software, Inc.
  • IBM
  • iDashboards
  • Oracle
  • Pentaho
  • R1Soft
  • Schooner Information Technology
  • SQLstream
  • Ticketmaster
  • Zmanda, Inc.
  • Linux Journal

Sponsorship Opportunities

For information on exhibition and sponsorship opportunities at the conference, contact Sharon Cordesse at

Download the MySQL Sponsor/Exhibitor Prospectus

Media Partner Opportunities

Download the Media & Promotional Partner Brochure (PDF) for information on trade opportunities with O'Reilly conferences or contact mediapartners@

Press and Media

For media-related inquiries, contact Maureen Jennings at

MySQL Conference Newsletter

To stay abreast of conference news and to receive email notification when registration opens, please sign up for the MySQL Conference newsletter.

Contact Us

View a complete list of MySQL contacts.