Dumping MySQL Stored Procedures, Functions and Triggers | |
Source |
MySQL 5 has introduced some new interesting features, like stored procedures and triggers. mysqldump will backup by default all the triggers but NOT the stored procedures/functions. There are 2 mysqldump parameters that control this behavior:
This means that if you want to include in an existing backup script also the triggers and stored procedures you only need to add the –routines command line parameter:
Let’s assume we want to backup ONLY the stored procedures and triggers and not the mysql tables and data (this can be useful to import these in another db/server that has already the data but not the stored procedures and/or triggers), then we should run something like:
|
Tweet |
Send by E-mail Print version |