13.7.7.18 SHOW EVENTS Statement语句

SHOW EVENTS
    [{FROM | IN} schema_name]
    [LIKE 'pattern' | WHERE expr]

This statement displays information about Event Manager events, which are discussed in Section 25.4, “Using the Event Scheduler”. 此语句显示有关事件管理器事件的信息,这些信息在第25.4节,“使用事件调度器”中进行了讨论。It requires the EVENT privilege for the database from which the events are to be shown.它要求显示事件的数据库具有EVENT权限

In its simplest form, SHOW EVENTS lists all of the events in the current schema:SHOW EVENTS以其最简单的形式列出了当前模式中的所有事件:

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:要查看特定架构的事件,请使用FROM子句。例如,要查看test模式的事件,请使用以下语句:

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 26.8, “Extensions to SHOW Statements”.LIKE子句(如果存在)指示要匹配的事件名称。WHERE子句可以用于使用更通用的条件来选择行,如第26.8节,“SHOW语句的扩展”所述。

SHOW EVENTS output has these columns:输出具有以下列:

For more information about SLAVESIDE_DISABLED and the Originator column, see Section 17.5.1.16, “Replication of Invoked Features”.

Times displayed by SHOW EVENTS are given in the event time zone, as discussed in Section 25.4.4, “Event Metadata”.

Event information is also available from the INFORMATION_SCHEMA EVENTS table. See Section 26.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.