mysqldump --routines --triggers mydb > mydb.sql

Category: Databases & SQL

mysqldump --routines --triggers mydb > mydb.sql

Back up stored routines and triggers

--routines adds procedures and functions; --triggers adds triggers (on by default, but explicit is safer). Restore with mysql mydb < mydb.sql. Related: mysqldump --single-transaction.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.