Backup MySQL Database to a file  

Posted by Karan Vora


Backing up your database is a very important system administration task, and should generally be run at scheduled intervals. We will use the mysqldump utility included with mysql to dump the contents of the database to a text file that can be easily re-imported.
Syntax:
mysqldump -h localhost -u root -pmypassword databasename > dumpfile.sql
Example:
mysqldump -h localhost -u root -p2Uad7as9 database001 > dumpfile.sql
This will give you a text file containing all the commands required to recreate the database.

This entry was posted on Thursday, 21 July 2011 at 16:11 . You can follow any responses to this entry through the comments feed .

0 comments

Post a Comment