Backing up and Restoring droplet MySQL database on my Windows computer

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 ?

Submit an answer

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!

Sign In or Sign Up to Answer

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