In this article, we will see how to get all triggers in MySQL database. We will present 3 ways to display all triggers for MySQL database tables.
1. Using SQL Query
The following SQL script should return a list of all triggers for tables of your database.
SELECT trigger_schema, trigger_name, event_object_table as table_name, event_manipulation, action_statement as trigger_statement FROM information_schema.triggers WHERE trigger_schema ='your_schema_name' ORDER BY table_name, trigger_name;
The result of the given query will display the triggers list:
2. Using MySQL interactive shell command-line
In the following, we will explain how you can display a list of all triggers for the table in a MySQL database using MySQL interactive shell command line. You can get a list of all triggers using the command.
3. List all triggers in MySQL database with ERBuilder Data Modeler
With ERBuilder Data Modeler you can display all triggers for a specific table in your MySQL database.
Firstly, reverse engineer your MySQL database with ERBuilder data modeler. You will get the ER diagram and all the objects of your database. From the treeview, you can see all triggers for a specific table in a MySQL database as shown in the screen down below.
Furthermore, you can display the trigger statement just by double-clicking on the trigger name and from there you can edit it, delete it or add new triggers for the table.
Subscribe To Our Newsletter
Subscribe to our email newsletter today to receive updates of the latest news, tutorials and special offers!