How to backup and restore a MySQL database?

You can use mysqldump to create a simple backup of your database using the following syntax.

mysqldump -u [username] -p [password] [databasename] > [backupfile.sql]


To Restore 
mysql -u [username] -p [password] [database_to_restore] < [backupfile]

Share

Leave a Reply

Your email address will not be published. Required fields are marked *