SHOW TRIGGERS

This MySQL statement displays a list of triggers on the server.

Syntax

Below is the syntax for this command. Text within square brackets (i.e, [ and ] ) are optional. Choices are separated by bars (i.e, | ). Ellipses preceded by a comma indicates a repeating pattern. Ellipses before or after syntax are used to highlight a relevant except from the larger syntax. Text displayed in italic letters represent text that should be replaced with the specific names related to the database (e.g., column with the name of the column).

SHOW TRIGGERS STATUS [FROM database]
[LIKE 'pattern'|WHERE expression]

Explanation

This MySQL statement displays a list of triggers on the MySQL 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.

Examples

Below is an example of this MySQL 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@localhost

See the MySQL statement, CREATE TRIGGER of our MySQL documentation for more information on triggers and how the trigger shown in the example above was created.