Dump all databases with SSH access

You can use the mysqldump command

mysqldump -u user -p --all-databases >file.sql

and a quick hack at a script which does much the same but puts the databases in individual files

#!/bin/bash

echo "show databases;" | mysql -u root --password='Password' | while read databa
sename
do
    echo dumping $databasename
    mysqldump -u root --password='Password' "$databasename" >"$databasename.sql"

done

If you have SSH access, you can the command:

mysqldump -u root -p --all-databases > /path/to/outfile

Then, you can download the generated file.


While connected with SSH, you can issue the following commands.

To dump all your MySQL databases:

mysqldump --user=<user> --password=<pwd> -A > /PATH/TO/DUMPFILE.SQL

If you want to dump specific databases:

mysqldump --user=<user> --password=<pwd> --databases DB_NAME1 DB_NAME2 DB_NAME3 > /PATH/TO/DUMPFILE.SQL

It's really that simple :)