MySQLDump doesn’t output procedures by defaultMay 22, 2008
Finished a big chunk of work on a local database and tried to push it to another server. Used MySQLDump to create the sql scripts to recreate the database, and everything was going fine until I realzied none of my lovely stored procedures were copied.
Some digging and I found a blog post detailing the use of the –routines parameter which solved my problem. The post in question had the format of the command wrong – and it was difficult to tell if he was using one or two dashes for the option format (note – always use courier when posting code) – so I had to read through the MySQLDump help text, which was very useful. Sometimes I need to be taught to fish just a little bit.
So, the command I use to dump the database is as follows:
mysqldump --user=root --password=something --routines product > product2008-06-16.sql