鍍金池/ 問答/數(shù)據(jù)庫/ mongo單個表恢復(fù)

mongo單個表恢復(fù)

我想恢復(fù)單個表,這樣寫的命令

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

用戶在哪個庫上創(chuàng)建,就應(yīng)該到哪個庫上認證。

2017年10月24日 15:02
編輯回答
單眼皮

首先問題肯定出在認證環(huán)節(jié) 確認用戶密碼后嘗試把雙引號去掉重試

2017年4月6日 04:17