Report this

What is the reason for this report?

Backing up and Restoring droplet MySQL database on my Windows computer

Posted on April 28, 2015

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 ?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.