Following command can be used to take a dump of an existing MySQL database.
mysqldump db-name --host=host-name --user=user-id --password=user-pass > init-db.sql
This will create a file called init-db.sql containing sql queries to reinitialize the database.
mysqldump db-name --host=host-name --user=user-id --password=user-pass > init-db.sql
This will create a file called init-db.sql containing sql queries to reinitialize the database.
Comments
I did a writeup on how to quickly setup this tool which may help you:
http://timarcher.com/?q=node/11
Its a really quick and easy way to backup your MySQL databases. I like the fact that it keeps daily, weekly, and monthly backups in separate folders, and manages purging old backups.