How to Backup and Restore a MySQL Database
by Samet Kilictas on Jun.07, 2009, under General
To make a database backup using the MySQL command-line utilities, execute the following command:
$ mysqldump -u username -p –opt dbname > dump.sql
It will ask you for password because we used -p paramater over there. If the MySQL programs are not in your path, you will need to manually specify the location of the mysqldump program:
$ /path-to-your-mysql-bin/mysqldump -u username -p –opt dbname > dump.sql
Download the dump.sql and keep it in a safe place (CDR, Zip disk, etc).
If you need to restore your database, you can do so like this:
$ mysql -u username -p dbname < dump.sql
This is the simples way to restore and backup your database.
Thanks for dropping by! Feel free to join the discussion by leaving comments, and stay updated by subscribing to the 
June 11th, 2009 on 8:34 pm
Thanks for the useful info. It’s so interesting