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

Subscribe to our news:
Partners
Testimonials
Michael Dunn: "We're good to go though, thank you again, this is by far the best MySQL interface I've had the opportunity to work with".
Torstein Krogh: "Some time ago, I tested all available tools on the market for maintaining MySQL and MySQL Maestro came up on top. My opinion is that MySQL should offer it as a free tool for all paying customers! They have nothing today, and doing MySQL DOS commands is not getting any new customers".

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