MySQL – Backup Stored Procedures, Functions & Triggers

Backup database include stored procedures

mysqldump -u db_user -p --routines DB_NAME > DB_BACKUP_FILES.sql

or

mysqldump -u db_user -p -R DB_NAME > DB_BACKUP_FILES.sql

Backup only stored procedures

mysqldump -u db_user -p --routines --no-create-info --no-data --no-create-db --skip-opt DB_NAME > SP_BACKUP.sql