Report this

What is the reason for this report?

How to export large mysql database from digitalocean cloud server into DigitalOcean Managed Databases?

Posted on September 20, 2020

Hi. There is a local mysql database on a cloud server with a size of 52GB+ How do I export it to DigitalOcean Managed Databases?



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.

Hi there @vlladoffwork,

I would usually use one of the tools listed on the MySQL website for exporting databases. I would usually default to the mysqldump tool here:

https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html

Example usage:

  1. mysqldump -h your_host -u your_user -p your_db_name > db-name.sql

However, for some extra performance I might sometimes use mysqlpump instead:

https://dev.mysql.com/doc/refman/8.0/en/mysqlpump.html

The syntax is quite similar:

  1. mysqlpump -h your_host -u your_user -p your_db_name > db-name.sql

Once you have the databased exported into a .sql file, you can import it with the mysql command into your Managed MySQL cluster.

Syntax:

  1. mysql -h your_host -u your_user -p your_db_name < db-name.sql

Hope that this helps! Regards, Bobby

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.