Report this

What is the reason for this report?

How to add a uploaded SQL gzipped file to MySQL on a managed database?

Posted on April 2, 2020

Hi, I uploaded a large (+1.5GB) gzipped SQL file to my dropplet and would like to add it to my MySQL DB hosted on a managed database. Since there is no SSH on managed DB how should I uncompress and install my SQL file?

Thanks!



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 @cmurph, is this a backup/data import that you would like to ingest into the instance?

Hi @cmurph,

You can add droplet ID to MySQL managed database trusted source so that you will be able to access the managed database from the droplet where you have placed (+1.5GB) gzipped SQL file (backup file); Then you can run the below command to import data (make changes to command with your database cluster hostname, password, database name, and SQL file name).

gunzip < backupfile.sql.gz| mysql -u doadmin -p'password' -h db-mysql-xxxx-xxxxx-do-user-xxxxxxx-0.b.db.ondigitalocean.com -P 25060 -D databasename

For more information on importing data to MySQL managed database check the below link : https://docs.digitalocean.com/products/databases/mysql/how-to/import-databases/

I hope this helps!

Regards, Rajkishore

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.