所在位置 行:1 字符: 28
+ db.createUser({user:"admin",pwd:"abc123456",roles:[{role:"root",db:"a ...
+ ~
参数列表中缺少参量。
所在位置 行:1 字符: 64
+ ... createUser({user:"admin",pwd:"abc123456",roles:[{role:"root",db:"admi ...
+ ~
参数列表中缺少参量。
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingArgument
--------------------------------------------------------------
--------------------------------------------------------------
执行后,有如上报错
2020-05-10 16:41:57
进入MongoDB,执行上述语句,重新启动Robo3T还是不行
PS C:\Users\meng_> mongo --host localhost --port 27017
MongoDB shell version v4.2.6
connecting to: mongodb://localhost:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("cb5fc4e4-6389-4947-91ac-ccd47835b449") }
MongoDB server version: 4.2.6
> db.createUser({user:"admin",pwd:"abc123456",roles:[{role:"root",db:"admin"}]})
2020-05-10T16:54:24.175+0800 E QUERY [js] uncaught exception: Error: couldn't add user: command createUser requires authentication :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DB.prototype.createUser@src/mongo/shell/db.js:1370:11
@(shell):1:1
2020-05-10 16:56:37
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星