mongo单个表恢复

我想恢复单个表,这样写的命令

mongorestore --username admin --password "pwdmongo" --db poi --collection newPoi newPoi.bson

但是一直提示错误

connected to: 127.0.0.1
assertion: 18 { ok: 0.0, errmsg: "auth failed", code: 18, codeName: "AuthenticationFailed" }

阅读 3.9k
2 个回答

首先问题肯定出在认证环节 确认用户密码后尝试把双引号去掉重试

试下加上--authenticationDatabase admin

mongorestore --username admin --password "pwdmongo" --db poi --collection newPoi newPoi.bson --authenticationDatabase admin

用户在哪个库上创建,就应该到哪个库上认证。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题