Documentation Home
MySQL 5.7 Reference Manual
Related Documentation Download this Manual Excerpts from this Manual

MySQL 5.7 Reference Manual  /  ...  /  SHOW CREATE TRIGGER Syntax SHOW CREATE TRIGGER Syntax


This statement shows the CREATE TRIGGER statement that creates the named trigger.

mysql> SHOW CREATE TRIGGER ins_sum\G
*************************** 1. row ***************************
               Trigger: ins_sum
SQL Original Statement: CREATE DEFINER=`me`@`localhost` TRIGGER ins_sum
                        BEFORE INSERT ON account
                        FOR EACH ROW SET @sum = @sum + NEW.amount
  character_set_client: utf8
  collation_connection: utf8_general_ci
    Database Collation: latin1_swedish_ci
               Created: 2013-07-09 10:39:34.96

SHOW CREATE TRIGGER output has the following columns:

  • Trigger: The trigger name.

  • sql_mode: The SQL mode in effect when the trigger executes.

  • SQL Original Statement: The CREATE TRIGGER statement that defines the trigger.

  • character_set_client: The session value of the character_set_client system variable when the trigger was created.

  • collation_connection: The session value of the collation_connection system variable when the trigger was created.

  • Database Collation: The collation of the database with which the trigger is associated.

  • Created: The date and time when the trigger was created. This is a TIMESTAMP(2) value (with a fractional part in hundredths of seconds) for triggers created in MySQL 5.7.2 or later, NULL for triggers created prior to 5.7.2. This column was added in MySQL 5.7.2.

You can also obtain information about trigger objects from INFORMATION_SCHEMA, which contains a TRIGGERS table. See Section 20.27, “The INFORMATION_SCHEMA TRIGGERS Table”.

Download this Manual
User Comments
Sign Up Login You must be logged in to post a comment.