how can I export mysql database using ssh?

2019-02-06 18:10发布

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

标签: mysql ssh
3条回答
放我归山
2楼-- · 2019-02-06 18:42
mysqldump db  | ssh test.host mysql db
查看更多
孤傲高冷的网名
3楼-- · 2019-02-06 18:53

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.

查看更多
乱世女痞
4楼-- · 2019-02-06 19:08

I guess its too late but for a detail answer for future reference:

mysqldump -uroot -p yourdbname > /var/dbbackup/backup.sql

here you can change the username root to yours -p will ask for your password later. and after the > you can mention your location where you want to save your backup file.

查看更多
登录 后发表回答