Mysqldump Multiple Databases

MotionGrafika

Member
Registered
Joined
Apr 17, 2016
Messages
52
Points
6
Hi everyone,

I have around 12 MySQL databases on a VPS, I want to backup all databases at the same time and download them to my local PC. However if i try to back them up via my hosting panel, it took so long to have a file downloaded. I heard that we can use Mysqldump to backup databases via command lines. It is possible, an dhow to backup all db files to a place on my VPS?

What commands can I use and how find find files after backed up?

Thanks!
MG
 

EcommIndiaCloudIT

Member
Registered
Joined
Dec 28, 2016
Messages
64
Points
0
A better way to do this would be to use MySQLWorkbench. Once you install the application, you can directly connect to your VPS and see all the databases from your local system. Then you can just copy them over to your local disk using import/export.
 

LJSHost

Well-known member
Hosting Provider
Registered
Joined
Jul 5, 2016
Messages
1,031
Points
63
Hi MotionGrafika,

This command will dump all databases into a single .sql backup file

Code:
 mysqldump --all-databases > all_databases.sql
or you can run the following for each database if you want each database in it's own separate backup file.

Code:
 mysqldump database_name > database_name.sql
 

Maxoq

Well-known member
Registered
Joined
Feb 25, 2015
Messages
520
Points
28
Hi everyone,

I have around 12 MySQL databases on a VPS, I want to backup all databases at the same time and download them to my local PC. However if i try to back them up via my hosting panel, it took so long to have a file downloaded. I heard that we can use Mysqldump to backup databases via command lines. It is possible, an dhow to backup all db files to a place on my VPS?

What commands can I use and how find find files after backed up?

Thanks!
MG
Using search function on the forum and you can easily find out a tutorial on how to use mysqldump to backup your databases
https://forumweb.hosting/11289-how-to-backup-and-restore-large-mysql-databases-by-mysqldump.html

Enjoy coding!
 

VirtuBox

Well-known member
Registered
Joined
May 3, 2016
Messages
1,622
Points
83
To backup all your database easily, there is a bash script available on github : https://github.com/MiteshShah/admin/blob/master/backup/mysqldump.sh

You just need to put your MySQL root credentials in a file .my.cnf into root's home folder (/root/.my.cnf) with the following content :
Code:
[client]
user = root
password = your_mysql_root_password
Then download the script :
Code:
wget https://raw.githubusercontent.com/MiteshShah/admin/master/backup/mysqldump.sh
And you can launch the backup :
Code:
bash mysqldump.sh
It will dump each MySQL database and put it in the folder /var/www/mysqldump
 
Older Threads
Replies
2
Views
2,421
Replies
18
Views
6,824
Replies
0
Views
1,705
Replies
40
Views
13,838
Recommended Threads
Replies
16
Views
4,549
Replies
12
Views
2,841
fiz

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top