##################################################################

 

一、版本对应:mongorestore版本要和mongodump版本一致,否则容易出问题:

 

 

mongorestore恢复某个数据库的所有集合:

/home/work/mongod/bin/mongorestore --authenticationDatabase admin --host 10.10.10.10 --port 28008 --username mongo_dba  --password 123456 --db gall   /home/work/mongodb/mongodb_backup/gall

 

 

 

mongorestore恢复某个集合数据:

/home/work/mongodb/3.6.17/bin/mongorestore --authenticationDatabase ai_open --host 10.10.10.10 --port 27017 --username apple --password 123456 

--db db_name --collection table_name ./bak/ai_open_caps/ai_caps_skill_info.bson

 

 

 恢复指定归档文件:

注意:--archive参数与文件名称之间要有=连接,用空格连接则会一直卡在那里:
注意:mongodump备份的时候,也需要加上参数--archive=filename
mongorestore  --authenticationDatabase admin   --host xxx --port  27001 --username root--password 123456 --archive=20210128_archive.bin 

 

 

 

 

 

 

 

 

 

##################################

相关文章:

  • 2021-09-19
  • 2021-11-04
  • 2022-12-23
  • 2021-04-30
  • 2021-07-27
猜你喜欢
  • 2021-12-17
  • 2021-06-03
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-12
相关资源
相似解决方案