Home > database >  Just installed under the redhat mongo but s completely unable to use instructions
Just installed under the redhat mongo but s completely unable to use instructions

Time:09-23



Just installed mongo, mainly in the night looking for the installation of the tutorial that is set up, operated by instruction cannot, can only use the user, dizzy ~ online to find other methods are not applicable,
Maybe my user is not authorized?
But I haven't create super user authorization?


mongo shell version v3.6.0
Connecting to: mongo://127.0.0.1:27017
Mongo server versio: 3.6.0



& gt; Use the admin
Switched to the db admin

The createUser ({
. User: "username",
. The PWD: "password",
. Roles: [" readWrite dbAdmin ", ""," dbOwner "]
. });
The 2019-03-19 T09:19:55. 749 + 0800 E QUERY [thread1] Error: couldn 't add user: not authorized on the admin to execute the command {createUser: "username", the PWD: "XXX", roles: [" readWrite ", "dbAdmin", "dbOwner"], digestPassword: false, writeConcern: {w: "majority", wtimeout: 600000.0}, $db: "admin"} :
_getErrorWithCode @ SRC/mongo/shell/utils. Js:
differingDB. Prototype. CreateUser @ SRC/mongo/shell/DB js: 1437:15
@ (shell) : 1:1


& gt; Show users
"T09:2019-03-19. 358 + 0800 E QUERY [thread1] Error: not authorized on the admin to execute the command {usersInfo: 1.0, $db:" admin "} :
_getErrorWithCode @ SRC/mongo/shell/utils. Js:
differingDB. The prototype. The getUsers @ SRC/mongo/shell/DB js: 1686:1
ShellHelper. Show @ SRC/mongo/shell/utils. Js: 793-9
ShellHelper @ SRC/mongo/shell/utils. Js: 700:15
@ (shellhelp2) : 1:1


& gt; The system. Users. The find ()
Error: Error: {
"Ok" : 0,
"Errmsg" : "not authorized on the test to the execute command {find: " system. The users \ ", the filter: {}, $db: \ "test "} ",
"Code" : 13,
"CodeName" : "Unauthorized"
}


& gt; Show DBS
The 2019-03-19 T09: when. 938 + 0800 E QUERY [thread1] Error: listDatabases failed: {
"Ok" : 0,
"Errmsg" : "not authorized on the admin to execute the command {listDatabases: 1.0, $db: " admin \ "} ",
"Code" : 13,
"CodeName" : "Unauthorized"
} :
_getErrorWithCode @ SRC/mongo/shell/utils. Js:
differingMongo. Prototype. GetDBs @ SRC/Mongo/shell/Mongo. Js: 65:1
ShellHelper. Show @ SRC/mongo/shell/utils. Js: 810:19
ShellHelper @ SRC/mongo/shell/utils. Js: 700:15
@ (shellhelp2) : 1:1
  • Related