Is it possible to export a Mysql database via SSH?

Gmeister4

Well-known member
Registered
Joined
Apr 19, 2016
Messages
178
Points
18
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
Moderator
Hosting Provider
Joined
Jan 18, 2017
Messages
775
Points
43
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
Registered
Joined
Apr 19, 2016
Messages
178
Points
18
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
Moderator
Hosting Provider
Joined
Jan 18, 2017
Messages
775
Points
43
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
Registered
Joined
Apr 19, 2016
Messages
178
Points
18
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
Moderator
Hosting Provider
Joined
Jan 18, 2017
Messages
775
Points
43
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
Registered
Joined
Apr 19, 2016
Messages
178
Points
18
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
Moderator
Hosting Provider
Joined
Jan 18, 2017
Messages
775
Points
43
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
Registered
Joined
Apr 19, 2016
Messages
178
Points
18
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
Moderator
Hosting Provider
Joined
Jan 18, 2017
Messages
775
Points
43
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
Registered
Joined
Apr 19, 2016
Messages
178
Points
18
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.
 

AlbaHost

Well-known member
Moderator
Hosting Provider
Joined
Jan 18, 2017
Messages
775
Points
43
AlbaHost
If you think so, then alright, just to let you know that winscp and filezilla were designed for such things too :)
 
Older Threads
Replies
2
Views
2,737
Replies
2
Views
1,922
Replies
2
Views
1,138
Newer Threads
Replies
8
Views
4,667
Replies
14
Views
3,272
Replies
6
Views
4,778
Replies
1
Views
1,986

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