How to write stored procedures to separate files with mysqldump?
- by Jader Dias
The mysqldump option --tab=path writes the creation script of each table in a separate file. But I can't find the stored procedures, except in the screen dump.
I need to have the stored procedures also in separate files.
The current solution I am working on is to split the screen dump programatically. Is there a easier way?
The code I am using so far is:
mysqldump -p$PASSWORD --routines --skip-dump-date --no-create-info --no-data --skip-opt $DATABASE > $BACKUP_PATH/$DATABASE.sql
mysqldump -p$PASSWORD --tab=$BACKUP_PATH --skip-dump-date --no-data --skip-opt $DATABASE