LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   mysqldump backup & restore with stored procedure & function (https://www.linuxquestions.org/questions/linux-server-73/mysqldump-backup-and-restore-with-stored-procedure-and-function-893982/)

ramecare 07-27-2011 01:27 AM

mysqldump backup & restore with stored procedure & function
 
Dear all,

Iam taking mysql backup from the below command

mysqldump -u root -pecare2@ softwareinfo > test1.sql
while restoring mysql backup iam using the below command

mysql -u root -pecare2@ softwareinfo < test1.sql

while restoring the mysqldump backup i was not able to get the database stored procedure,triggers& functions,can any one help on the command how to take database backup with stored procedure,triggers & functions.

Thanks

radoulov 07-27-2011 02:58 AM

You need to add --routines and --triggers to the backup command.

roastinghosting 07-27-2011 03:07 AM

We used to use this mysqldump method for backups for a while but you might find using automysqlbackup.sh a better solution - it will dump your database and take care of daily,weekly,monthly rotations of the backups for you. We then grab these using backuppc.

---------- Post added 07-27-11 at 08:07 AM ----------

Sorry it's available here: http://sourceforge.net/projects/automysqlbackup/

ramecare 07-27-2011 07:06 AM

Thank u very much as per radoulov advice i used the below command its working fine.
mysqldump -u root -pecare2@ --routines dumile_deskas_misdemo > /netdrive/dumile_deskas_misdemo.sql

Thanks,


All times are GMT -5. The time now is 04:40 AM.