???????3?????????????
????c:Program Filesmongodbin>mongo
????MongoDB shell version: 2.4.1
????connecting to: test
????> use admin
????switched to db admin
??????????????????
????> db.addUser("test"??"123456")
????Fri Apr 05 14:01:31.404 JavaScript execution failed: error: { "$err" : "not authorized for query on admin.system.users"?? "code" : 16550 } at src/mongo/shell/query.js:L128
???????????ж??
????> db.auth("root"??"admin");
????1
????> use admin
????switched to db admin
????> db.addUser("test"??123456)
????{
????"user" : "test"??
????"readOnly" : false??
????"pwd" : "c8ef9e7ab00406e84cfa807ec082f59e"??
????"_id" : ObjectId("515e68e2be252e81c5dee198")
????}
????> show collections
????system.indexes
????system.users
????> db.system.users.find()
????{ "_id" : ObjectId("515e662430d89f61f6991c91")?? "user" : "root"?? "readOnly" : fa
????lse?? "pwd" : "bde0d84f6749c235a6b4e36d945eb666" }
????{ "_id" : ObjectId("515e68e2be252e81c5dee198")?? "user" : "test"?? "readOnly" : fa
????lse?? "pwd" : "c8ef9e7ab00406e84cfa807ec082f59e" }
????>