我想恢复单个表,这样写的命令
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" }
我想恢复单个表,这样写的命令
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" }
试下加上--authenticationDatabase admin
mongorestore --username admin --password "pwdmongo" --db poi --collection newPoi newPoi.bson --authenticationDatabase admin
用户在哪个库上创建,就应该到哪个库上认证。
5 回答3.3k 阅读✓ 已解决
2 回答2.9k 阅读✓ 已解决
1 回答2.4k 阅读✓ 已解决
1 回答3k 阅读✓ 已解决
1 回答2k 阅读✓ 已解决
3 回答2.3k 阅读
1 回答1.3k 阅读✓ 已解决
首先问题肯定出在认证环节 确认用户密码后尝试把双引号去掉重试