mongodb创建用户

MongoDB Enterprise >use abcdb  //切换到abcdb库

MongoDB Enterprise >db.createUser({user: "abc",pwd: "abc123",roles: [ { role: "readWrite", db: "abcdb" } ]});
Successfully added user: {
"user" : "abc",
"roles" : [
{
"role" : "readWrite",
"db" : "abcdb"
}
]
}

posted @ 2017-03-03 21:40  夏天的西瓜君  阅读(407)  评论(0编辑  收藏  举报