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

阅读量:44
阅读量:29
阅读量:120
阅读量:143
阅读量:196