EVENT_SCHEMA: The name of the schema
(database) to which this event belongs.

EVENT_NAME: The name of the event.

DEFINER: The account of the user who
created the event, in
'user_name'@'host_name'
format.

TIME_ZONE: The event time zone, which is
the time zone used for scheduling the event and that is in
effect within the event as it executes. The default value is
SYSTEM.

EVENT_BODY: The language used for the
statements in the event's DO
clause; in MySQL 5.6, this is always
SQL.

This column is not to be confused with the column of the same
name (now named EVENT_DEFINITION) that
existed in earlier MySQL versions.

EVENT_DEFINITION: The text of the SQL
statement making up the event's
DO clause; in other words, the
statement executed by this event.

EVENT_TYPE: The event repetition type,
either ONE TIME (transient) or
RECURRING (repeating).

EXECUTE_AT: For a one-time event, this is
the DATETIME value specified in
the AT clause of the
CREATE EVENT statement used to
create the event, or of the last ALTER
EVENT statement that modified the event. The value
shown in this column reflects the addition or subtraction of
any INTERVAL value included in the event's
AT clause. For example, if an event is
created using ON SCHEDULE AT CURRENT_TIMESTAMP +
'1:6' DAY_HOUR, and the event was created at
2006-02-09 14:05:30, the value shown in this column would be
'2006-02-10 20:05:30'.

If the event's timing is determined by an
EVERY clause instead of an
AT clause (that is, if the event is
recurring), the value of this column is
NULL.

INTERVAL_VALUE: For recurring events, this
column contains the numeric portion of the event's
EVERY clause.

For a one-time event (that is, an event whose timing is
determined by an AT clause), this column is
NULL.

INTERVAL_FIELD: For recurring events, this
column contains the units portion of the
EVERY clause governing the timing of the
event. Thus, this column contains a value such as
'YEAR',
'QUARTER', 'DAY', and so
on.

For a one-time event (that is, an event whose timing is
determined by an AT clause), this column is
NULL.

SQL_MODE: The SQL mode in effect when the
event was created or altered, and under which the event
executes. For the permitted values, see
Section 5.1.7, “Server SQL Modes”.

STARTS: For a recurring event whose
definition includes a STARTS clause, this
column contains the corresponding
DATETIME value. As with the
EXECUTE_AT column, this value resolves any
expressions used.

If there is no STARTS clause affecting the
timing of the event, this column is NULL

ENDS: For a recurring event whose
definition includes a ENDS clause, this
column contains the corresponding
DATETIME value. As with the
EXECUTE_AT column, this value resolves any
expressions used.

If there is no ENDS clause affecting the
timing of the event, this column is NULL.

STATUS: One of the three values
ENABLED, DISABLED, or
SLAVESIDE_DISABLED.

SLAVESIDE_DISABLED indicates that the
creation of the event occurred on another MySQL server acting
as a replication master and was replicated to the current
MySQL server which is acting as a slave, but the event is not
presently being executed on the slave. See
Section 17.4.1.11, “Replication of Invoked Features”, for more
information.

ON_COMPLETION: One of the two values
PRESERVE or NOT
PRESERVE.

CREATED: The date and time when the event
was created. This is a
TIMESTAMP value.

LAST_ALTERED: The date and time when the
event was last modified. This is a
TIMESTAMP value. If the event
has not been modified since its creation, this column holds
the same value as the CREATED column.

LAST_EXECUTED: The date and time when the
event last executed. A DATETIME
value. If the event has never executed, this column is
NULL.

LAST_EXECUTED indicates when the event
started. As a result, the ENDS column is
never less than LAST_EXECUTED.

EVENT_COMMENT: The text of a comment, if
the event has one. If not, the value of this column is an
empty string.

ORIGINATOR: The server ID of the MySQL
server on which the event was created; used in replication.
The default value is 0.

CHARACTER_SET_CLIENT: The session value of
the character_set_client
system variable when the event was created.

COLLATION_CONNECTION: The session value of
the collation_connection
system variable when the event was created.

DATABASE_COLLATION: The collation of the
database with which the event is associated.

Example: Suppose that the user
jon@ghidora creates an event named
e_daily, and then modifies it a few minutes
later using an ALTER EVENT
statement, as shown here:

DELIMITER |
CREATE EVENT e_daily
ON SCHEDULE
EVERY 1 DAY
COMMENT 'Saves total number of sessions then clears the table each day'
DO
BEGIN
INSERT INTO site_activity.totals (time, total)
SELECT CURRENT_TIMESTAMP, COUNT(*)
FROM site_activity.sessions;
DELETE FROM site_activity.sessions;
END |
DELIMITER ;
ALTER EVENT e_daily
ENABLED;

(Note that comments can span multiple lines.)

This user can then run the following
SELECT statement, and obtain the
output shown: