MongoDB Authentication 적용.
ITWeb/개발일반 2013. 1. 11. 13:33몽고 문서에 잘 나와 있내요.
http://docs.mongodb.org/manual/tutorial/control-access-to-mongodb-with-authentication/
rs0:PRIMARY> use admin
switched to db admin
rs0:PRIMARY> db.addUser("henry", "1111")
{
"user" : "henry",
"readOnly" : false,
"pwd" : "16c0f96a725f2b331d1a0359c7305d81",
"_id" : ObjectId("50ef9510cfc8ac6e4cc62ae2")
}
rs0:PRIMARY> show dbs
admin 0.203125GB
demo 0.203125GB
local 6.0126953125GB
rs0:PRIMARY> use demo
switched to db demo
rs0:PRIMARY> db.addUser("henry", "1111")
{
"user" : "henry",
"readOnly" : false,
"pwd" : "16c0f96a725f2b331d1a0359c7305d81",
"_id" : ObjectId("50ef9542cfc8ac6e4cc62ae3")
}
rs0:PRIMARY> db.auth("henry", "1111")
1
rs0:PRIMARY>