Mysqldump Multiple Databases

Joined
Apr 17, 2016
Messages
52
Best answers
0
Points
6
#1
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
 
Joined
Dec 28, 2016
Messages
64
Best answers
0
Ratings
30
Points
0
#2
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
Joined
Jul 5, 2016
Messages
1,031
Best answers
0
Ratings
202
Points
63
#3
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
Joined
Feb 25, 2015
Messages
333
Best answers
0
Ratings
38 1
Points
28
#4
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

Global Mod
Staff Member
Joined
May 3, 2016
Messages
1,517
Best answers
4
Ratings
392 12
Points
83
#6
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
Latest Threads
Replies
0
Views
9
Replies
0
Views
9
Replies
0
Views
9
Replies
2
Views
38
Replies
4
Views
21

Latest postsNew threads

Latest Hosting OffersNew Reviews

Sponsors

Latest Blog ArticlesMost Viewed Threads

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