本文共 506 字,大约阅读时间需要 1 分钟。
在增加mongodb的账号密码时候,实现有误,提示无法增加role这个权限,但明明已经是root的最高权限
> use adminswitched to db admin> db.createUser({... user: 'manong', ... pwd: '123456', ... roles:[{... role: 'root', ... db: 'database' ... }],... mechanisms : ["SCRAM-SHA-1"] ... })2022-08-06T00:29:57.805+0800 E QUERY [thread1] Error: couldn't add user: Could not find role: root@database :_getErrorWithCode@src/mongo/shell/utils.js:25:13DB.prototype.createUser@src/mongo/shell/db.js:1437:15@(shell):1:1
截图如下:
转载地址:http://sjffk.baihongyu.com/