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

WBOY
發布: 2023-08-30 23:37:02
轉載
1123 人瀏覽過

我們如何取得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
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板