Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

17. Supporting MySQL 5.0 and 5.1 > Exploring the Event Scheduler

Exploring the Event Scheduler

The Event Scheduler (see http://dev.mysql.com/doc/refman/5.1/en/events.html), another new feature of MySQL 5.1, permits the creation of tasks that will run automatically according to a schedule. The schedule is quite flexible and permits, for example, a statement to be run every ten seconds, starting from midnight, May 18, 2011. These can be one-time events or recurring ones.

Activating the scheduler

We should first verify whether the scheduler is active on our server. If not, we need to activate it. Otherwise, nothing will happen! We start by typing the following statement in the query box:

SHOW VARIABLES LIKE 'event%';

Next, we look for a variable named event_scheduler. If this variable is set to OFF, then we need to ask the system administrator (or someone with the SUPER privilege) to execute the following statement:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint