RSS Feed

How to dump MySQL stored procedures

When dumping a MySQL database, by default, stored procedures and functions will not be backed up. If you want to backup stored procedures as well as the structure and data you can specify the –routines option on mysqldump.

mysqldump -u -p –routines > backup.sql

If you only need to dump the stored procedures, for example the database is big and you already have an export of everything bar the routines you can use the following command:

mysqldump -u -p –routines –no-create-info –no-data –no-create-db –skip-opt > procedures_backup.sql

The above command tells mysqldump not to include the table creation SQL, the insert SQL, the database creation SQL and the database options, if any.

Posted in Linux on the 27th October 2010

2 people have spoken their minds!

  1. Pingback: Tweets that mention How to dump MySQL stored procedures | srcnix's obsessions --

  2. Pingback: Eufeion Tutorial 5 - Climbing Bass |


Your email address will not be published. Required fields are marked *