Yugal Yugal - 1 year ago 116
SQL Question

how to export MySQL database with triggers and procedures?

How to export/dump mysql database with all triggers and procedures.

Answer Source

mysqldump will backup by default all the triggers but NOT the stored procedures/functions. There are 2 mysqldump parameters that control this behavior:

* `–routines` – FALSE by default
* `–triggers` – TRUE by default

so in mysqldump command , add --routines like :

mysqldump <other mysqldump options> --routines > outputfile.sql

read more in this article

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download