标签:创建 create 备份 role 恢复 restore -- pre tor
创建恢复用户
db.createUser({user:"huifu",pwd:"123456",roles:[{role:"restore",db:"admin"}]})
创建备份用户
db.createUser({user:"beifen",pwd:"123456",roles:[{role:"backup",db:"admin"}]})
#备份
mongodump -h 192.168.233.133:27017 -u beifen -p 123456 -d test -o /tmp/backup/
#恢复
mongorestore --host=192.168.233.133 --port=27017 -u huifu -p 123456 -d test /tmp/backup/test
标签:创建 create 备份 role 恢复 restore -- pre tor
原文地址:https://blog.51cto.com/baoyc/2420283