Backing Up and Restoring Your MySQL Database

by mtecheasy on January 16, 2011

The easiest way to backup and restore your mysql database is the following:

Backing up your database:
mysqldump -u username -p password database > backupfile.sql

– username – this is your database username
– password – this is the password for your database
– database – the name of your database
– backupfile.sql – the file to which the backup should be written.

Restoring your database:
mysql -u username -p password database < backupfile

Leave a Reply