Name
SHOW TRIGGERS
Synopsis
SHOW TRIGGERS STATUS [FROMdatabase] [LIKE 'pattern'|WHEREexpression]
This statement displays a list of triggers on the server. The
database to which triggers are related may be given in the
FROM clause; the default is the current database.
The LIKE or WHERE clauses can be
used to list triggers based on a particular naming pattern. The
LIKE clause includes the name of the table with which the trigger is
associated or a pattern for the table name that includes wildcards
(%). With the WHERE clause, you
can use the names of fields in the results to create an expression
that sets a condition determining the results returned. Here is an
example using this statement:
SHOW TRIGGERS LIKE 'students' \G
*************************** 1. row ***************************
Trigger: students_deletion
Event: DELETE
Table: students
Statement: BEGIN
INSERT INTO students_deleted
(student_id, name_first, name_last)
VALUES(OLD.student_id, OLD.name_first, OLD.name_last);
END
Timing: BEFORE
Created: NULL
sql_mode:
Definer: root@localhostSee CREATE TRIGGER earlier in this chapter for more information on triggers and to see how the trigger shown was created.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access