Question

mysqldump on an Ubuntu PhpMyAdmin droplet

I’m trying to download a huge database from a droplet, its probably too big for PhpMyAdmin so i’m trying to run mysqldump from terminal and the sftp to grab the resulting file, however every option i try via terminal fails, usually with : mysqldump “unknown option -b”, but i’ve had other issues with the command getting the password confused with the table names, is there something wrong in my script, or is the version of mysqldump on this type of server not standard?

mysqldump -u user -p password -databases my_db > /home/database-dump.sql

also tried with no space after the p:

mysqldump -u user -ppassword -databases my_db > /home/database-dump.sql


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 @gabba,

You are almost doing the proper command, here it is

mysqldump -u User -p NameOfDatabase -h localhost > /home/database-dump.sql

Once you run the command, you’ll be asked to add type in the password. Paste it in the terminal and hit enter.

That’s it, you should now have your dump file.

Regards, KDSys