SHOW EVENTS
[{FROM | IN} schema_name]
[LIKE 'pattern' | WHERE expr]
This statement displays information about Event Manager events,
which are discussed in Section 27.5, “Using the Event Scheduler”. It
requires the EVENT privilege for
the database from which the events are to be shown.
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: 1
Interval field: DAY
Starts: 2018-08-08 11:06:34
Ends: NULL
Status: ENABLED
Originator: 1
character_set_client: utf8mb4
collation_connection: utf8mb4_0900_ai_ci
Database Collation: utf8mb4_0900_ai_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 28.8, “Extensions to SHOW Statements”.
SHOW EVENTS output has these
columns:
DbThe name of the schema (database) to which the event belongs.
NameThe name of the event.
DefinerThe account of the user who created the event, in
'format.user_name'@'host_name'Time zoneThe 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.TypeThe event repetition type, either
ONE TIME(transient) orRECURRING(repeating).Execute AtFor a one-time event, this is the
DATETIMEvalue specified in theATclause of theCREATE EVENTstatement used to create the event, or of the lastALTER EVENTstatement that modified the event. The value shown in this column reflects the addition or subtraction of anyINTERVALvalue included in the event'sATclause. For example, if an event is created usingON SCHEDULE AT CURRENT_TIMESTAMP + '1:6' DAY_HOUR, and the event was created at 2018-02-09 14:05:30, the value shown in this column would be'2018-02-10 20:05:30'. If the event's timing is determined by anEVERYclause instead of anATclause (that is, if the event is recurring), the value of this column isNULL.Interval ValueFor 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 FieldThe 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.StartsThe start date and time for a recurring event. This is displayed as a
DATETIMEvalue, and isNULLif no start date and time are defined for the event. For a transient event, this column is alwaysNULL. For a recurring event whose definition includes aSTARTSclause, this column contains the correspondingDATETIMEvalue. As with theExecute Atcolumn, this value resolves any expressions used. If there is noSTARTSclause affecting the timing of the event, this column isNULLEndsFor a recurring event whose definition includes a
ENDSclause, this column contains the correspondingDATETIMEvalue. As with theExecute Atcolumn, this value resolves any expressions used. If there is noENDSclause affecting the timing of the event, this column isNULL.StatusThe event status. One of
ENABLED,DISABLED, orREPLICA_SIDE_DISABLED.REPLICA_SIDE_DISABLEDindicates that the creation of the event occurred on another MySQL server acting as a replication source and replicated to the current MySQL server which is acting as a replica, but the event is not presently being executed on the replica. For more information, see Section 19.5.1.16, “Replication of Invoked Features”. information.REPLICA_SIDE_DISABLEDreplacesSLAVESIDE_DISABLED, which is now deprecated and subject to removal in a future version of MySQL.OriginatorThe server ID of the MySQL server on which the event was created; used in replication. This value may be updated by
ALTER EVENTto the server ID of the server on which that statement occurs, if executed on a source server. The default value is 0.character_set_clientThe session value of the
character_set_clientsystem variable when the event was created.collation_connectionThe session value of the
collation_connectionsystem variable when the event was created.Database CollationThe collation of the database with which the event is associated.
For more information about
REPLICA_SIDE_DISABLED and the
Originator column, see
Section 19.5.1.16, “Replication of Invoked Features”.
Times displayed by SHOW EVENTS
are given in the event time zone, as discussed in
Section 27.5.4, “Event Metadata”.
Event information is also available from the
INFORMATION_SCHEMA
EVENTS table. See
Section 28.3.14, “The INFORMATION_SCHEMA EVENTS Table”.
The event action statement is not shown in the output of
SHOW EVENTS. Use
SHOW CREATE EVENT or the
INFORMATION_SCHEMA
EVENTS table.