SQL Maestro for MySQL online help
Prev | Return to chapter overview | Next |
Events
MySQL 5.1.6 and later provides several SQL statements for working with scheduled events. The events are tasks that run according to a schedule. Therefore, sometimes they are named as scheduled events. When you create an event, you are creating a named database object containing one or more SQL statements to be executed at one or more regular intervals, beginning and ending at a specific date and time. Conceptually, this is similar to the idea of the Unix crontab (also known as a "cron job") or the Windows Task Scheduler. MySQL Events can be used in two main ways:
• | Scheduling actions The database server carries out a set of actions on a schedule of times. You could use this capability to schedule backups, validity checks, queries to fill up reporting tables, and so on. |
• | Event handling actions The database server carries out a set of actions when a predefined event occurs. The events that can be handled include disk space restrictions (when a disk fills beyond a specified percentage), when the database server is idle, and so on. The actions of an event handler are committed if no error is detected during execution, and rolled back if errors are detected. |
New events are created within Create Event Wizard. In order to run the wizard you should either
or
or
To create a new event with the same properties as one of the existing event has:
|
Events can be edited within Event Editor. In order to run the editor you should either
or
|
To drop a event:
or
and confirm dropping in the dialog window.
|