Mongodb备份恢复
1、备份所有数据库(数据库账号guoke,密码55)
mongodump -u guoke -p 55 --authenticationDatabase admin -o /root/backupall

2、备份单个数据库
mongodump -u guoke -p 55 -d test --authenticationDatabase admin -o /root/backuptest

3、备份某个表
mongodump -u guoke -p 55 --authenticationDatabase admin -d test -c myTest -o /root/backuptest_my

1、恢复所有数据库
mongorestore -u guoke -p 55 --authenticationDatabase admin /root/backupall

2、恢复单个数据库
mongorestore -u guoke -p 55 --authenticationDatabase admin /root/backuptest

3、恢复单个表
mongorestore -u guoke -p 55 --authenticationDatabase admin -d test -c myTest /root/backuptest_my/test/myTest.bson

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:149
阅读量:44
阅读量:96
阅读量:185
阅读量:167