MySQLDump doesn’t output procedures by default

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

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s