Cannot authenticate into mongo, “auth fails”
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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: 1 8 { code: 1 8 , ok: 0.0, errmsg: "auth fails" } at src/mongo/shell/db.js:L22 8 I have auth = true in etc/mongod.conf. What am I missing? 回答1: Authentication