Har*_*rry 134
列出所有触发器的命令是:
show triggers;
Run Code Online (Sandbox Code Playgroud)
或者您可以通过以下方式INFORMATION_SCHEMA直接访问该表:
select trigger_schema, trigger_name, action_statement
from information_schema.triggers
Run Code Online (Sandbox Code Playgroud)
TRIGGERS表的更多信息,请点击此处.Pra*_*ria 13
我希望以下代码能为您提供更多信息.
select * from information_schema.triggers where
information_schema.triggers.trigger_schema like '%your_db_name%'
Run Code Online (Sandbox Code Playgroud)
这将为您提供MySQL版本中的总共22列:5.5.27及以上
TRIGGER_CATALOG
TRIGGER_SCHEMA
TRIGGER_NAME
EVENT_MANIPULATION
EVENT_OBJECT_CATALOG
EVENT_OBJECT_SCHEMA
EVENT_OBJECT_TABLE
ACTION_ORDER
ACTION_CONDITION
ACTION_STATEMENT
ACTION_ORIENTATION
ACTION_TIMING
ACTION_REFERENCE_OLD_TABLE
ACTION_REFERENCE_NEW_TABLE
ACTION_REFERENCE_OLD_ROW
ACTION_REFERENCE_NEW_ROW
CREATED
SQL_MODE
DEFINER
CHARACTER_SET_CLIENT
COLLATION_CONNECTION
DATABASE_COLLATION
Run Code Online (Sandbox Code Playgroud)
Kai*_*nda 12
您可以使用以下内容查找特定的触发器定义.
SHOW TRIGGERS LIKE '%trigger_name%'\G
Run Code Online (Sandbox Code Playgroud)
或以下显示数据库中的所有触发器.它适用于MySQL 5.0及更高版本.
SHOW TRIGGERS\G
Run Code Online (Sandbox Code Playgroud)
小智 9
要在特定模式中显示特定触发器,您可以尝试以下操作:
select * from information_schema.triggers where
information_schema.triggers.trigger_name like '%trigger_name%' and
information_schema.triggers.trigger_schema like '%data_base_name%'
Run Code Online (Sandbox Code Playgroud)