0

Below is the error I get if I start mongo shell and try to see which dbs are there, tried using both bitnami as well as ubuntu as users, also what is root pwd for bitnami root user so i can try using that as well.

MongoDB shell version v3.4.2
connecting to: mongodb:///opt/bitnami/mongodb/tmp/mongodb-27017.sock/
MongoDB server version: 3.4.2
> show dbs;
2017-11-08T07:14:01.123+0000 E QUERY    [thread1] Error: listDatabases 
failed:{
    "ok" : 0,
    "errmsg" : "not authorized on admin to execute command { 
listDatabases: 1.0 }",
"code" : 13,
"codeName" : "Unauthorized"
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
Mongo.prototype.getDBs@src/mongo/shell/mongo.js:62:1
shellHelper.show@src/mongo/shell/utils.js:755:19
shellHelper@src/mongo/shell/utils.js:645:15
@(shellhelp2):1:1
  • You did not log in with credentials. Hence "not authorized". Does the error message need to be worded more clearly? Bottom line is you need a user. There is either one created or you need to create one, and there is plenty of documentation on that. The user needs the `clusterAdmin` privilege in order to list databases. – Neil Lunn Nov 08 '17 at 07:42
  • sorry i am new to mongodb and programming in itself, the thing is i am not even able to run any command, not even creating user in mongodb. i ssh using bitnami or ubuntu user, and in even any on-admin db i still get same erroe – JackSparrow Nov 08 '17 at 08:07
  • You should check the documentation on the VM you installed. You get "not authorised" because it already would have set an admin user. If you cannot find it, then the documentation ( and linked answers ) does tell you how to bypass authorization and create/update accounts and credentials. – Neil Lunn Nov 08 '17 at 08:11

0 Answers0