Oct 05 2011

mysqldump: do not forget to routines!

Tag: MySQLJens @ 23:45

For creating MySQL backups you can easily use utility mysqldump. However, this utility don’t dump stored procedures and functions by default. With using parameter --routines, stored routines (procedures and functions created by CREATE PROCEDURE and CREATE FUNCTION) will be included into database dump. This behavior of mysqldump is quite confusing, because TRIGGERS are included in database dump by default.

So, if you are using stored procedures and functions, do not forget to update your commands like this:

mysqldump --routines [other parameters] > [database dump file]

For more information, see mysqldump manual pages :