
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
How we can find all the triggers associated with a particular MySQL table?
We can find all the triggers associated with a particular table with the help of the following query −
mysql> Select * from INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_SCHEMA = 'query'AND EVENT_OBJECT_TABLE = 'Student_info'\G *************************** 1. row *************************** TRIGGER_CATALOG: def TRIGGER_SCHEMA: query TRIGGER_NAME: studentinfo_after_delete EVENT_MANIPULATION: DELETE EVENT_OBJECT_CATALOG: def EVENT_OBJECT_SCHEMA: query EVENT_OBJECT_TABLE: student_info ACTION_ORDER: 1 ACTION_CONDITION: NULL ACTION_STATEMENT: BEGIN DECLARE vuser varchar(30); SELECT USER() into vuser; INSERT INTO student_info_deleted(id,deleted_date,deleted_by) VALUES(OLD.id,SYSDATE(),vuser); END ACTION_ORIENTATION: ROW ACTION_TIMING: AFTER ACTION_REFERENCE_OLD_TABLE: NULL ACTION_REFERENCE_NEW_TABLE: NULL ACTION_REFERENCE_OLD_ROW: OLD ACTION_REFERENCE_NEW_ROW: NEW CREATED: 2017-11-21 14:19:34.91 SQL_MODE: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION DEFINER: root@localhost CHARACTER_SET_CLIENT: cp850 COLLATION_CONNECTION: cp850_general_ci DATABASE_COLLATION: latin1_swedish_ci 1 row in set (0.00 sec)
The above result set is showing the list of triggers on the ‘student_info’ table in the database named ‘query’.
- Related Articles
- How can we fetch all the records from a particular MySQL table?
- How can we use SIGNAL statement with MySQL triggers?
- How can we find out the storage engine used for a particular table in MySQL?
- How can we fetch a particular row as output from a MySQL table?
- How can we check the list of all triggers in a database?
- How can we delete all rows from a MySQL table?
- How can we use INFORMATION_SCHEMA to get the details about triggers in a particular database?
- How can we list all the columns of a MySQL view as we can list the columns of a MySQL table?
- How to insert DATE in MySQL table with TRIGGERS?
- How can we check the character set of all the tables in a particular MySQL database?
- How can we update MySQL table after removing a particular string from the values of column?
- How can we display all the records from MySQL table with the help of PHP script?
- How can we export all the data from MySQL table into a text file?
- How can we export all the data from MySQL table into a CSV file?
- Update MySQL table on INSERT command with triggers?

Advertisements