What commands I can use at ssh to export(download) mysql database using SSH?
我可以在ssh使用什么命令来使用SSH导出(下载)mysql数据库?
3 个解决方案
#1
23
To export a mysql dump using SSH, execute the following command:
要使用SSH导出mysql转储,请执行以下命令:
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
看看这里:MySQL通过SSH导入和导出(.sql文件)
Hope this helps.
希望这可以帮助。
#2
4
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.
在这里你可以将用户名root更改为你的用户-p稍后会询问你的密码。在>之后,您可以提及您要保存备份文件的位置。
#3
0
mysqldump db | ssh test.host mysql db
#1
23
To export a mysql dump using SSH, execute the following command:
要使用SSH导出mysql转储,请执行以下命令:
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
看看这里:MySQL通过SSH导入和导出(.sql文件)
Hope this helps.
希望这可以帮助。
#2
4
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.
在这里你可以将用户名root更改为你的用户-p稍后会询问你的密码。在>之后,您可以提及您要保存备份文件的位置。
#3
0
mysqldump db | ssh test.host mysql db