Por que complicar demais?
Criar backup
mysqldump -u <user> -p<password> <database> > backup.sql
Restaurar
mysql -u <user> -p<password> <database> < backup.sql
mysqldump -u <user> -p<password> <database> > backup.sql
mysql -u <user> -p<password> <database> < backup.sql