Rumah >pangkalan data >tutorial mysql >Bagaimanakah kita mendapatkan metadata acara MySQL?

Bagaimanakah kita mendapatkan metadata acara MySQL?

WBOY
WBOYke hadapan
2023-08-30 23:37:021149semak imbas

Bagaimanakah kita mendapatkan metadata acara MySQL?

Ini boleh dilakukan dengan bantuan pangkalan data INFORMATION_SKEMA. Pernyataan berikut akan memberi kita metadata acara -

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)

Atas ialah kandungan terperinci Bagaimanakah kita mendapatkan metadata acara MySQL?. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!

Kenyataan:
Artikel ini dikembalikan pada:tutorialspoint.com. Jika ada pelanggaran, sila hubungi admin@php.cn Padam