mongodb 增加用户以及认证用户
时间:2021-07-01 10:21:17
帮助过:13人阅读
>db.addUser(
‘yshy‘,
‘yshy‘)
{
"user" :
"yshy",
"readOnly" :
false,
"pwd" :
"2059c25b25df531ec5652d3eba0dc175",
"_id" : ObjectId(
"5556a6da70d9c8c0f6a120ab")
}
admin>db.auth(
‘yshy‘,
‘yshy‘)
1
admin>db.system.users.
find()
{ "_id" : ObjectId(
"545ab87bdc558a6592571d5b"),
"user" :
"yanshiying",
"readOnly" :
false,
"pwd" :
"044f63528e7807275411c4731052fe36" }
{ "_id" : ObjectId(
"5556a6da70d9c8c0f6a120ab"),
"user" :
"yshy",
"readOnly" :
false,
"pwd" :
"2059c25b25df531ec5652d3eba0dc175" }
admin>
mongodb 增加用户以及认证用户
标签: