Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can I export mysql database using ssh?

Tags:

mysql

ssh

What commands I can use at ssh to export(download) mysql database using SSH?

like image 351
CryptoMiningPoolSetupYiimp Avatar asked Jan 13 '12 16:01

CryptoMiningPoolSetupYiimp


People also ask

How do I export MySQL from terminal?

First of all open command prompt then open bin directory in cmd (i hope you're aware with cmd commands) go to bin directory of your MySql folder in WAMP program files. press enter system will export particular database and create sql file to the given location.

How do I backup my SSH database?

By using SSH, it is very easy to create a backup (dump) of your entire database. Once at the shell prompt, type in the following command and press [enter]: mysqldump -h 127.0. 0.1 -u db_user -p db_name > db_backup.


1 Answers

To export a mysql dump using SSH, execute the following command:

mysqldump -u username -p dbname > db_dump.sql

username -> your mysql username
dbname   -> databse name

Enter password when prompted. and you are done.

Have a look here: MySQL Import and Export (.sql file) via SSH

Hope this helps.

like image 151
AlphaMale Avatar answered Oct 10 '22 02:10

AlphaMale



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!