How can I find all the db triggers in MySQL?

25,881

Solution 1

Click on the 'SQL' tab and enter this query:

SHOW TRIGGERS

Solution 2

select * from information_schema.triggers where trigger_schema = 'your_db'

Solution 3

to see all your routines the code is...

select * from information_schema.routines
Share:
25,881
Tattat
Author by

Tattat

Updated on July 31, 2022

Comments

  • Tattat
    Tattat almost 2 years

    I created a trigger using SQL, how can I see the trigger using MySQL in phpMyadmin?

  • Nicola Cossu
    Nicola Cossu over 13 years
    You can use mysqldump with --triggers switch dev.mysql.com/doc/refman/5.0/en/mysqldump.html
  • Devart
    Devart over 13 years
    Or you can use Database Backup or Gen.Schema Script in dbForge Studio for MySQL.
  • dionyziz
    dionyziz over 12 years
    There are commands to manage a database schema other than interacting directly with the information_schema database such as SHOW TRIGGERS which should be preferred.
  • sdjuan
    sdjuan over 11 years
    mysqldump backs up triggers by default: "--triggers Include triggers for each dumped table in the output. This option is enabled by default;"
  • daker
    daker over 9 years
    Is this the best way if you want to create a view of your triggers? SHOW TRIGGERS is not valid in "AS" for create view.