SHOW EVENTS [{FROM | IN}schema_name
] [LIKE 'pattern
' | WHEREexpr
]
In its simplest form, SHOW EVENTS
lists all of the events in the current schema:
mysql>SELECT CURRENT_USER(), SCHEMA();
+----------------+----------+ | CURRENT_USER() | SCHEMA() | +----------------+----------+ | jon@ghidora | myschema | +----------------+----------+ 1 row in set (0.00 sec) mysql>SHOW EVENTS\G
*************************** 1. row *************************** Db: myschema Name: e_daily Definer: jon@ghidora Time zone: SYSTEM Type: RECURRING Execute at: NULL Interval value: 10 Interval field: SECOND Starts: 2006-02-09 10:41:23 Ends: 0000-00-00 00:00:00 Status: ENABLED Originator: 0 character_set_client: latin1 collation_connection: latin1_swedish_ci Database Collation: latin1_swedish_ci
The LIKE
clause, if present,
indicates which event names to match. The
WHERE
clause can be given to select rows
using more general conditions, as discussed in
Section 19.28, “Extensions to SHOW
Statements”.
The columns in the output of SHOW
EVENTS
— which are similar to, but not identical
to the columns in the
INFORMATION_SCHEMA.EVENTS
table
— are shown here:
Db
: The schema (database) on which the
event is defined.
Name
: The name of the event.
Time zone
: The time zone in effect when
schedule for the event was last modified. If the event's
schedule has not been modified since the event was created,
then this is the time zone that was in effect at the event's
creation. The default value is SYSTEM
.
This column was added in MySQL 5.1.17. See Section C.2.25, “Changes in MySQL 5.1.17 (04 April 2007)”, for important information if you are using the Event Scheduler and are upgrading from MySQL 5.1.16 (or earlier) to MySQL 5.1.17 (or later).
Definer
: The user account
(
)
which created the event.
user_name
@host_name
Type
: One of the two values ONE
TIME
(transient) or RECURRING
.
Execute At
: The date and time when a
transient event is set to execute. Shown as a
DATETIME
value.
For a recurring event, the value of this column is always
NULL
.
Interval Value
: For a recurring event,
the number of intervals to wait between event executions.
For a transient event, the value of this column is always
NULL
.
Interval Field
: The time units used for
the interval which a recurring event waits before repeating.
For a transient event, the value of this column is always
NULL
.
Starts
: The start date and time for a
recurring event. This is displayed as a
DATETIME
value, and is empty
if no start date and time are defined for the event. (Prior
to MySQL 5.1.8, it defaulted to '0000-00-00
00:00:00'
in such cases.)
For a transient event, the value of this column is always
NULL
.
Ends
: The end date and time for a
recurring event. This is displayed as a
DATETIME
value, and defaults
to '0000-00-00 00:00:00'
if no end date
and time is defined for the event.
For a transient event, the value of this column is always
NULL
.
Status
: The event status. One of
ENABLED
, DISABLED
, or
SLAVESIDE_DISABLED
.
SLAVESIDE_DISABLED
was added in MySQL
5.1.18. This value indicates that the creation of the event
occurred on another MySQL server acting as a replication
master and replicated to the current MySQL server which is
acting as a slave, but the event is not presently being
executed on the slave.
Originator
: The server ID of the MySQL
server on which the event was created. Defaults to 0. This
column was added in MySQL 5.1.18.
character_set_client
is the
session value of the
character_set_client
system
variable when the routine was created.
collation_connection
is the
session value of the
collation_connection
system
variable when the routine was created. Database
Collation
is the collation of the database with
which the routine is associated. These columns were added in
MySQL 5.1.21.
For more information about SLAVE_DISABLED
and
the Originator
column, see
Section 16.3.1.8, “Replication of Invoked Features”.
Note that the action statement is not shown in the output of
SHOW EVENTS
.
Prior to MySQL 5.1.17, the values displayed for
Starts
and Ends
(other
than '0000-00-00 00:00:00'
) were shown using
Universal Time (Bug#16420). Beginning with MySQL 5.1.17, these
times are all given in terms of local time as determined by the
MySQL server's time_zone
setting. See also Section 19.20, “The INFORMATION_SCHEMA EVENTS
Table”.
To see events for a different schema, you can use the
FROM
clause. For example, if the
test
schema had been selected in the
preceding example, you could view events defined on
myschema
using the following statement:
SHOW EVENTS FROM myschema;
You can filter the list returned by this statement on the event
name using LIKE
plus a pattern.
This statement was added in MySQL 5.1.6.
See also Section 19.20, “The INFORMATION_SCHEMA EVENTS
Table”.
In MySQL 5.1.11 and earlier, SHOW
EVENTS
displayed only those events for which the
current user was the definer, and the SHOW FULL
EVENTS
statement was used for viewing events defined
by all users on a given schema. SHOW FULL
EVENTS
was removed in MySQL 5.1.12.
User Comments
Add your own comment.