Question

Backing up and Restoring droplet MySQL database on my Windows computer

Posted April 28, 2015 3.8k views
CentOS MySQL Backups

My Centos 6 droplet is running MySQL 5.1 . I have created and have been running an extensive database on the droplet .I’ve been controlling the droplet via a Putty console on my Windows 7 machine. What would be the best way for me to back up the content of my MySQL database onto my Windows machine and restore from it to the droplet ?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

1 answer

The most direct method would be to use mysqldump to create a backup of your database as a .sql file. This guide from the official documentation should be helpful.

To re-import this data to your server you would want to drop all tables in your database and then import the .sql file:

mysql -uroot -p mydatabase < mybackup.sql
Submit an Answer