What commands I can use at ssh to export(download) mysql database using SSH?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.
回答2:
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.
回答3:
mysqldump db | ssh test.host mysql db