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: NULL Status: ENABLED Originator: 0 character_set_client: latin1 collation_connection: latin1_swedish_ci Database Collation: latin1_swedish_ci
To see events for a specific schema, use the
FROM
clause. For example, to see events for
the test
schema, use the following statement:
SHOW EVENTS FROM test;
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”.
SHOW EVENTS
output has the
following columns:
Db
: The schema (database) on which the
event is defined.
Name
: The name of the event.
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
.
Definer
: The account of the user who
created the event, in
'
format.
user_name
'@'host_name
'
Type
: The event repetition type, either
ONE TIME
(transient) or
RECURRING
(repeating).
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
NULL
if no start date and time are
defined for the event.
For a transient event, 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 NULL
if no end date and time is
defined for the event.
For a transient event, this column is always
NULL
.
Status
: The event status. One of
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 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.
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.
For more information about SLAVE_DISABLED
and
the Originator
column, see
Section 16.4.1.8, “Replication of Invoked Features”.
The event action statement is not shown in the output of
SHOW EVENTS
. Use
SHOW CREATE EVENT
or the
INFORMATION_SCHEMA.EVENTS
table.
Times displayed by SHOW EVENTS
are given in the event time zone, as discussed in
Section 18.4.4, “Event Metadata”.
The columns in the output of SHOW
EVENTS
are similar to, but not identical to the
columns in the
INFORMATION_SCHEMA.EVENTS
table.
See Section 19.20, “The INFORMATION_SCHEMA EVENTS
Table”.
User Comments
Add your own comment.