DROP TRIGGER [IF EXISTS] [schema_name.]trigger_name
此语句用于删除触发器。模式(数据库)名称为可选。如果省略模式,则从默认模式中删除触发器。DROP TRIGGER 需要对与触发器相关联的表拥有 TRIGGER 权限。This statement drops a trigger. The schema (database) name is
optional. If the schema is omitted, the trigger is dropped from
the default schema. DROP TRIGGER
requires the TRIGGER privilege for
the table associated with the trigger.
使用 IF EXISTS 可以防止对不存在的触发器产生错误。对于使用 IF EXISTS 的不存在触发器,会生成一个 NOTE。参见 第 15.7.7.42 节,“SHOW WARNINGS 语句”。Use IF EXISTS to prevent an error from
occurring for a trigger that does not exist. A
NOTE is generated for a nonexistent trigger
when using IF EXISTS. See
Section 15.7.7.42, “SHOW WARNINGS Statement”.
如果删除表,表的触发器也会被删除。Triggers for a table are also dropped if you drop the table.