In the process of upgrading my desktop installation of MySQL I
noticed that, unlike triggers, stored procedures are not
automatically dumped, that's a "not so nice" feature of
mysqldump, sic, here is a snippet for those who don't have time
to check the manual
C:\Documents and Settings\user>mysqldump -uroot --single-transaction --routines
--databases test remote_test > c:/backup_mysql_20_05_07.sql
-- routines does the trick.
--single-transaction is InnoDB specific for a consistent backup
(doesn't apply to MyISAM and other table handlers)
--databases is used because I want to backup only a specific
number of databases
Note that after MySQL 5.0.11 triggers are dumped automagically
(option enabled by default), use --skip-triggers if downgrading
your table structure.
Note also that before 5.0.11 triggers were not dumped and
routines had to wait till 5.0.13 …