How To Backup and Restore MySQL into a file
To prevent any data loses, most Database administrator must have backup their database frequently. This tutorial will show you how to backup MySQL Database into a file and also how to restore the database from the backup file.
Backup the database
Backing up your database is a very important system administration task, and should generally be run from a cron job 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.
Okay, this is the syntax or command to backup MySQL database into a file
mysqldump -h localhost -u root –p mypassword databasename > dumpfile.sql
For example, I have a local database named “test” and the password is “gambliscom” then I have to execute this command below to backup my database into a file named “mybackup”








