我使用最新的mongo,并尝试按照Mongo文档中所述设置SuperUserAdmin。无法在mongo中进行身份验证localhost
1) Start ./mongod --dbpath ../data without auth
2) Run ./mongo
3) [mongo shell]: use admin
4) [mongo shell]: db.addUser({ user: "admin",
pwd: "abcde1234",
roles: [ "userAdminAnyDatabase" ] })
5) [mongo shell]: db.shutdownServer()
then i restart mongod with auth:
6) ./mongod --auth --dbpath ../data
7) Run mongo (as localhost) again: ./mongo -u admin -p abcde1234
Then i get this error:
Javascript executiion failed: Error: 18 {code:18, ok:0.0, errmsg: 'auth fails'} at src/mongo/shell/db.js:L228
我尝试了不同的用户名密码&,同样的事情..我失去了
什么?我在我的Mac上运行。
任何人有任何想法?
即使设置了dbAdminAnyDatabase,它也不起作用,或者至少对于测试数据库来说它仍然失败,只要在'create a user administrator'中描述的方法。但管理数据库的日志很好。任何一个解决这个问题的人? – 2013-11-24 12:48:03