What is the command to list all triggers in a MySQL database?
What is the command to list all triggers in a MySQL database?
The command for listing all triggers is:
show triggers;
or you can access the INFORMATION_SCHEMA table directly by:
select trigger_schema, trigger_name, action_statement
from information_schema.triggers
TRIGGERS table is here.You can use MySQL Workbench: Connect to the MySQL Server Select DB
This sentence could contribute to solving the problem:
select LOWER(concat('delimiter |', '\n', 'create trigger %data_base_name%.', TRIGGER_NAME, '\n',
' ', ACTION_TIMING, ' ', EVENT_MANIPULATION, ' on %data_base_name%.', EVENT_OBJECT_TABLE, ' for each row', '\n',
ACTION_STATEMENT, '\n',
'|')) AS TablaTriggers from information_schema.triggers where
information_schema.triggers.trigger_schema like '%data_base_name%'