Question

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

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!


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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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

Hi @cmurph, is this a backup/data import that you would like to ingest into the instance?