首頁 >資料庫 >mysql教程 >我們如何取得MySQL事件的元資料?

我們如何取得MySQL事件的元資料?

WBOY
WBOY轉載
2023-08-30 23:37:021144瀏覽

我們如何取得MySQL事件的元資料?

這可以藉助 INFORMATION_SCHEMA 資料庫來完成。以下語句將為我們提供事件的元資料 -

mysql> SELECT * from INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME LIKE '%event%' A

ND EVENT_SCHEMA = 'query'\G
*************************** 1. row ***************************
      EVENT_CATALOG: def
       EVENT_SCHEMA: query
         EVENT_NAME: testing_event6
            DEFINER: root@localhost
          TIME_ZONE: SYSTEM
         EVENT_BODY: SQL
   EVENT_DEFINITION: INSERT INTO event_message(message,generated_at) values('EVENT ALTERED', NOW())
         EVENT_TYPE: ONE TIME
         EXECUTE_AT: 2017-11-22 20:03:52
     INTERVAL_VALUE: NULL
     INTERVAL_FIELD: NULL
           SQL_MODE: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
             STARTS: NULL
               ENDS: NULL
             STATUS: DISABLED
      ON_COMPLETION: PRESERVE
            CREATED: 2017-11-22 20:02:52
       LAST_ALTERED: 2017-11-22 21:01:17
      LAST_EXECUTED: 2017-11-22 20:03:52
       EVENT_COMMENT:
          ORIGINATOR: 0
CHARACTER_SET_CLIENT: cp850
COLLATION_CONNECTION: cp850_general_ci
  DATABASE_COLLATION: latin1_swedish_ci

*************************** 2. row ***************************

       EVENT_CATALOG: def
        EVENT_SCHEMA: query
          EVENT_NAME: testing_event_with_preserves
             DEFINER: root@localhost
           TIME_ZONE: SYSTEM
          EVENT_BODY: SQL
    EVENT_DEFINITION: INSERT INTO event_MESSAGES(Message, generated_at) Values('Altered',NOW())
          EVENT_TYPE: RECURRING
          EXECUTE_AT: NULL
      INTERVAL_VALUE: 1
      INTERVAL_FIELD: MINUTE
            SQL_MODE: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
              STARTS: 2017-11-22 21:03:01
                ENDS: NULL
              STATUS: DISABLED
       ON_COMPLETION: PRESERVE
             CREATED: 2017-11-22 20:35:12
        LAST_ALTERED: 2017-11-22 21:04:42
       LAST_EXECUTED: 2017-11-22 20:35:12
       EVENT_COMMENT:
          ORIGINATOR: 0
CHARACTER_SET_CLIENT: cp850
COLLATION_CONNECTION: cp850_general_ci
  DATABASE_COLLATION: latin1_swedish_ci
2 rows in set (0.00 sec)

以上是我們如何取得MySQL事件的元資料?的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:tutorialspoint.com。如有侵權,請聯絡admin@php.cn刪除