Friday 22 August 2014

How to Backup MySQL Database?

To take a backup of MySQL database or databases, the database must exist in the database server and you must have access to it. The format of the command would be.

# mysqldump -u [username] –p[password] [database_name] > [dump_file.sql]
The parameters of the said command as follows.
[username] : A valid MySQL username. 
[password] : A valid MySQL password for the user. 
[database_name] : A valid Database name you want to take backup. 
[dump_file.sql] : The name of backup dump file you want to generate.