Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
Padster Reynolds: "Good software that has become one of our must have tools - wouldn't like to be without it these days. Keep up the good work".
Juan Guzman: "MySQL Maestro seemed like an extremely useful, very robust software and very well designed too. Congratulations".

More

Add your opinion

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

 

select the Object | Create Database Object... main menu item;
select the Event icon in the Create Database Object dialog

or

select the Events list or any object from that list in the explorer tree;
select the Create New Event... item from the popup menu

or

open the database in Database Editor and the Events tab there;
press the Insert key or select the Create New Event... item from the popup menu (alternatively, you may use the corresponding link of the Navigation Bar).

 

To create a new event with the same properties as one of the existing event has:

 

select the Object | Duplicate Database Object... main menu item;
follow the instructions of Duplicate Object Wizard.

 

 

 

Events can be edited within Event Editor. In order to run the editor you should either

 

select the event for editing in the explorer tree (type the first letters of the event name for quick search);
select the Edit Event ... item from the popup menu

or

open the database in Database Editor and the Events tab there;
select the event to edit;
press the Enter key or select the Edit Event item from the popup menu (alternatively, you may use the corresponding link of the Navigation Bar).

 

 

 

To drop a event:

 

select the event to drop in the explorer tree;
select the Drop Event item from the popup menu

or

open the database in Database Editor and the Events tab there;
select the event to drop;
press the Delete key or select the Drop Event item from the popup menu (alternatively, you may use the corresponding link of the Navigation Bar)

 

and confirm dropping in the dialog window.

 



Prev Return to chapter overview Next