Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I would like to know how to dump all databases into a folder. I'm using a Linux/Debian Afer connecting on the server with root access I make

$ mysql -u admin -p

To connect on mysql.

Then which commands are to extract all databases created in my Plesk Panel?

share|improve this question

4 Answers 4

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.

share|improve this answer

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
share|improve this answer
    
This is the best. You realy help to me. –  Seik Dec 6 '11 at 17:01

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 :)

share|improve this answer

Then which commands are to extract all databases created in my Plesk Panel?

What's plesk got to do with it?

Just ssh on and run mysqldump, writing the output to a directory you can read via ssh/ftp/http and download the files.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.