Search tutorial by keyword

How to take backups & restore backups in MySQL server

 

In this post we will discuss how to take and restore backups of MySQL database.

You can load a dump back into a database also

Take dump of the database by the following command

#mysqldump -u(username) -p(password) (databasename) > cacti.sql

Here cacti.sql is the backup file which will be the backup of my database 

Now if you want to restore the database you have to first make a database then load this file into the newly made database 

#mysql -u(username) -p(password)

> create database cacti;

>quit

Now a database named cacti is created and you can restore the dump by the following command

mysql -u(username) -p(password) cacti < cacti.sql

If you want just the structure dump of a database then following command will be used

#mysqldump -u(username) -p(password)  --no-data (databasename) > cacti.sql

*Here cacti is the newly created database in which we have loaded the backup dump

Michael Dudli

Cloud Specialist with more than 10 years experience in the Hosting Business.

Website: www.cloudserver24.com

42410 comments

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.

Kontakt

Verkauf

sales@cloudserver24.com

Support

support@cloudserver24.com