Question

mysqldump on an Ubuntu PhpMyAdmin droplet

Posted January 28, 2020 110 views
MySQL

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

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.

×
1 answer

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

Submit an Answer