Is it possible to export a Mysql database via SSH?

Gmeister4

Well-known member
Joined
Apr 19, 2016
Messages
145
Best answers
0
Ratings
10
Points
18
#1
How can I export a Mysql database via SSH? I have too many my website databases and it consumed me more time when exporting databases from Phpmyadmin. I would like to know a way to export faster and download databases to my PC . Thanks in advance.
 

AlbaHost

Well-known member
Joined
Jan 18, 2017
Messages
308
Best answers
1
Ratings
79 4
Points
28
#2
How can I export a Mysql database via SSH? I have too many my website databases and it consumed me more time when exporting databases from Phpmyadmin. I would like to know a way to export faster and download databases to my PC . Thanks in advance.
Google do magic, just need to use it:

mysqldump --all-databases > all_databases.sql

and then download it.
 

Gmeister4

Well-known member
Joined
Apr 19, 2016
Messages
145
Best answers
0
Ratings
10
Points
18
#3
Gmeister4
I am checking on this.
Can I download specific databases as wanted? and where databases will be dumped to?
To run the command above, do I need to login into Mysql server first?
 

AlbaHost

Well-known member
Joined
Jan 18, 2017
Messages
308
Best answers
1
Ratings
79 4
Points
28
#4
AlbaHost
For one database:

mysqldump database_name > database_name.sql

For multiple databases at the same time:

mysqldump --databases database_one database_two > two_databases.sql

And for all databases i just posted in my previous post, you need login to your ssh as root and after you run mentioned commands your backup will be in same directory where you are.
 

Gmeister4

Well-known member
Joined
Apr 19, 2016
Messages
145
Best answers
0
Ratings
10
Points
18
#5
Gmeister4
hmm....It will be stored in root folder :unsure:
You forget to guide me how to move database_one or database_two file to public_html on my domain so I can download them with a URL :)
 

AlbaHost

Well-known member
Joined
Jan 18, 2017
Messages
308
Best answers
1
Ratings
79 4
Points
28
#6
AlbaHost
Yeah, wait for a little and i will do all the job for you for sure ;) you can login to your root with winscp or filezilla without moving them to public_html directory for security reasons.
Or if you don't mind for security, then just move with:
mv database.sql /home/username/public_html
 

Gmeister4

Well-known member
Joined
Apr 19, 2016
Messages
145
Best answers
0
Ratings
10
Points
18
#7
Gmeister4
Thanks for guiding me, I need to do this on my servers and see how it works.
Of course I will move them to public_html to easily download with a download program on Windows and I will remove database files after download by using rm filename.sql :)
 

AlbaHost

Well-known member
Joined
Jan 18, 2017
Messages
308
Best answers
1
Ratings
79 4
Points
28
#8
AlbaHost
Don't be lazy with valued data, just use winscp or filezilla and download it on your pc, that's best solution.
 

Gmeister4

Well-known member
Joined
Apr 19, 2016
Messages
145
Best answers
0
Ratings
10
Points
18
#9
Gmeister4
I know and installed these programs but rarely use them because the speed of downloading is very slow if compared with some download programs from Windows as internet download manager, for example.
 

AlbaHost

Well-known member
Joined
Jan 18, 2017
Messages
308
Best answers
1
Ratings
79 4
Points
28
#10
AlbaHost
Hell yeah, if your internet speed is slow, why do you think that it will faster downloading files directly from website?
 

Gmeister4

Well-known member
Joined
Apr 19, 2016
Messages
145
Best answers
0
Ratings
10
Points
18
#11
Gmeister4
Because those programs are design for purposes to download files from internet so they will be faster than filezilla or winscp or other FPT programs. I tried and always use them when download files from my websites.
 
Older Threads
Replies
2
Views
210
Replies
0
Views
108
Replies
2
Views
97
Newer Threads
Replies
8
Views
396
Replies
14
Views
414
Replies
6
Views
534
Replies
1
Views
137
Latest Threads
  • Deleted
  • Deleted by Localnode
  • Reason: Wrong section
Replies
0
Views
4
  • Deleted
  • Deleted by fwh
Replies
0
Views
1
Replies
16
Views
105
Recommended 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