SHOW CREATE TRIGGER trigger_name
This statement shows the 此语句显示创建命名触发器的CREATE TRIGGER statement that creates the named trigger. CREATE TRIGGER语句。This statement requires the 此语句要求与触发器关联的表具有TRIGGER privilege for the table associated with the trigger.TRIGGER权限。
mysql> SHOW CREATE TRIGGER ins_sum\G
*************************** 1. row ***************************
               Trigger: ins_sum
              sql_mode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,
                        NO_ZERO_IN_DATE,NO_ZERO_DATE,
                        ERROR_FOR_DIVISION_BY_ZERO,
                        NO_ENGINE_SUBSTITUTION
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: utf8mb4
  collation_connection: utf8mb4_0900_ai_ci
    Database Collation: utf8mb4_0900_ai_ci
               Created: 2018-08-08 10:10:12.61
SHOW CREATE TRIGGER output has these columns:输出具有以下列:
Trigger: The trigger name.:触发器名称。
sql_mode: The SQL mode in effect when the trigger executes.:触发器执行时生效的SQL模式。
SQL Original Statement: The :定义触发器的CREATE TRIGGER statement that defines the trigger.CREATE TRIGGER语句。
character_set_client: The session value of the :创建触发器时character_set_client system variable when the trigger was created.character_set_client系统变量的会话值。
collation_connection: The session value of the :创建触发器时collation_connection system variable when the trigger was created.collation_connection系统变量的会话值。
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.TIMESTAMP(2)值(以百分之一秒为单位的小数部分)。
Trigger information is also available from the 触发器信息也可从INFORMATION_SCHEMA TRIGGERS table. See Section 26.3.45, “The INFORMATION_SCHEMA TRIGGERS Table”.INFORMATION_SCHEMA TRIGGERS表中获得。参见第26.3.45节,“INFORMATION_SCHEMA触发器表”。