I've created an admin user for mongo using these directions:
http://docs.mongodb.org/manual/tutorial/add-user-administrator/
From the mongo client it looks like I can authenticate:
> use admin
switched to db admin
> db.auth('admin','SECRETPASSWORD');
1
>
But I can't connect any other way. For example:
mongo -u admin -p SECRETPASSWORD
gives the error:
JavaScript execution failed: Error: 18 { code: 18, ok: 0.0, errmsg: "auth fails" } at src/mongo/shell/db.js:L228
I have auth = true
in etc/mongod.conf
.
What am I missing?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…