MySQL :: MySQL 8.0 Reference Manual :: 27.4.4 Event Metadata (original) (raw)
27.4.4 Event Metadata
To obtain metadata about events:
- Query the EVENTS table of the
INFORMATION_SCHEMA
database. SeeSection 28.3.14, “The INFORMATION_SCHEMA EVENTS Table”. - Use the SHOW CREATE EVENT statement. See Section 15.7.7.7, “SHOW CREATE EVENT Statement”.
- Use the SHOW EVENTS statement. See Section 15.7.7.18, “SHOW EVENTS Statement”.
Event Scheduler Time Representation
Each session in MySQL has a session time zone (STZ). This is the session time_zone value that is initialized from the server's globaltime_zone value when the session begins but may be changed during the session.
The session time zone that is current when aCREATE EVENT orALTER EVENT statement executes is used to interpret times specified in the event definition. This becomes the event time zone (ETZ); that is, the time zone that is used for event scheduling and is in effect within the event as it executes.
For representation of event information in the data dictionary, the execute_at
, starts
, andends
times are converted to UTC and stored along with the event time zone. This enables event execution to proceed as defined regardless of any subsequent changes to the server time zone or daylight saving time effects. Thelast_executed
time is also stored in UTC.
Event times can be obtained by selecting from the Information Schema EVENTS table or fromSHOW EVENTS, but they are reported as ETZ or STZ values. The following table summarizes representation of event times.
Value | EVENTS Table | SHOW EVENTS |
---|---|---|
Execute at | ETZ | ETZ |
Starts | ETZ | ETZ |
Ends | ETZ | ETZ |
Last executed | ETZ | n/a |
Created | STZ | n/a |
Last altered | STZ | n/a |