Skip to content

Commit ab6d128

Browse files
authored
Update MongoDB-Install-And-Settings.md
1 parent 0673c4c commit ab6d128

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

MongoDB-Install-And-Settings.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,17 @@ child process started successfully, parent exiting
157157
use youmeek
158158
```
159159

160-
- 创建用户,并授权:
160+
- 创建用户,并授权,需要注意的是:dbAdmin 的权限是没有包含 readWrite,所以很多时候要根据需求添加多个权限
161161

162162
```
163163
db.createUser(
164164
{
165165
user: "youmeek",
166166
pwd: "youmeek123456",
167-
roles: [ { role: "dbAdmin", db: "youmeek" } ]
167+
roles: [
168+
{ role: "dbAdmin", db: "youmeek" },
169+
{ role: "readWrite", db: "youmeek" }
170+
]
168171
}
169172
)
170173
```
@@ -218,7 +221,7 @@ db.createUser(
218221
- 修改密码:`db.changeUserPassword(用户名, 密码)`
219222
- 删除用户:` db.removeUser(用户名)`
220223
- 内置角色:
221-
- Read:允许用户读取指定数据库
224+
- read:允许用户读取指定数据库
222225
- readWrite:允许用户读写指定数据库
223226
- dbAdmin:允许用户在指定数据库中执行管理函数,如索引创建、删除,查看统计或访问system.profile
224227
- userAdmin:允许用户向system.users集合写入,可以找指定数据库里创建、删除和管理用户

0 commit comments

Comments
 (0)