21

I have the following user:

{
    "_id" : "admin.root",
    "user" : "root",
    "db" : "admin",
    "roles" : [
        {
            "role" : "root",
            "db" : "admin"
        }
    ]
}

And for my database:

{
    "_id" : "mydb.mydbDbOwner",
    "user" : "mydbDbOwner",
    "db" : "mydb",
    "roles" : [
        {
            "role" : "dbOwner",
            "db" : "mydb"
        }
    ]
}

I can't connect via Robomongo on localhost:

Enter image description here

The same goes for...

Database: mydb
User Name: root

Database: mydb
User Name: mydbDbOwner

How can I fix this problem?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
basickarl
  • 37,187
  • 64
  • 214
  • 335
  • Have you enabled authentication in your config file? If not it will only allow localhost access to your database. – Tdorno Mar 29 '15 at 04:27
  • @Tdorno Indeed! `etc/mangodb.conf`auth=true – basickarl Mar 29 '15 at 04:46
  • 1
    What version of MongoDB & Robomongo are you using? If you are using MongoDB 3.0, Robomongo 0.8.x doesn't have support for the new SCRAM-SHA-1 default authentication. See [issue #766](https://github.com/paralect/robomongo/issues/766) in Robomongo's GitHub issue tracker. – Stennie Mar 29 '15 at 06:06
  • 1
    @Stennie You are correct! Post an answer and I'll accept :) – basickarl Mar 29 '15 at 06:24
  • @KarlMorrison Are you using mmap (default) or WiredTiger storage engine? There's a possible authentication workaround if you're using mmap. – Stennie Mar 29 '15 at 06:29
  • @Stennie default. I'm lucky as I'm running localhost I just turned the `Perform authentication` off and connected. This will be an issue for a remote connection though so I hope the patch is released before that! – basickarl Mar 29 '15 at 06:33
  • Also, if anybody is facing issues deciphering the connection string, see my answer here: http://stackoverflow.com/a/35935789/1578274 – Vaibhav Mar 11 '16 at 08:59

6 Answers6

28

Robomongo 0.8.x doesn't have support for the new SCRAM-SHA-1 authentication which was the default authentication method added in MongoDB 3.0.

Robomongo 0.9.0 RC4 (Feb 2016) added support for SCRAM-SHA-1, but if you are using a modern version of MongoDB server you should upgrade to the latest version of Robomongo (now Robo3T) currently available.

There is also an officially maintained free GUI, MongoDB Compass, which is more actively updated than Robo3T. MongoDB Compass 1.22+ (Sept 2020) includes an embedded MongoDB shell.

Stennie
  • 63,885
  • 14
  • 149
  • 175
  • 1
    latest version of Robomongo 0.9.0 RC4 supports scram-sha-1 authentication, could you update your answer? – Andrew Orsich Feb 01 '16 at 23:54
  • @AndrewOrsich The answer is still correct (0.8.x doesn't support SCRAM-SHA-1 but this will be part of the 0.9.0 release). I would wait for the final Robomongo 0.9.0 release to know what features are included and link to the actual release announcement. – Stennie Feb 02 '16 at 00:53
  • How did it go? [The answer can be edited](https://stackoverflow.com/posts/29326527/edit) (***without*** "Edit:", "Update:", or similar - the answer should appear as if it was written today) - e.g. *"... version 0.9.0 of Robomongo (released 2016-XX-XX) added support for SCRAM-SHA-1 authentication."* – Peter Mortensen Feb 13 '21 at 16:48
8

I was experiencing exactly the same issue on Mac. I removed the Robomongo client and download the latest version from their website. It just works :)

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Athar
  • 579
  • 5
  • 12
0

You can try Mongo-Express (a web-based tool).

However, you need to upgrade the MongoDB-Node.js library to be at least (1.4.29) according to Upgrade to SCRAM.

I tried and it worked for my case. You can find the below useful command for that:

npm install mongo-express cd node-modules/mongo-express

Change the config.default.js file to config.js and update it to include your database connection (e.g., username, password, connection's URL, etc.)

Edit the package.jon file and change the version of MongoDB to "~1.4.29"

Run: npm update

To start the web application: execute command "node app" and the web site will be available at http://localhost:8081/.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Duy Nguyen
  • 226
  • 3
  • 6
0

You can change localhost to 127.0.0.1

Dzumi
  • 9
  • 3
0

I just upgraded to the new version 1.0 of Robomongo. As a few people stated in here, 0.8.x didn’t support SCRAM-SHA-1, which is default in MongoDB 3.0. In prior versions it was MONGODB-CR.

But anyone who is downloading Robomongo from this point on shouldn't have an issue with authentication.

https://robomongo.org/

This bottom links explains SCRAM-SHA a bit more. I suggest reading into it if heavily using MongoDB.

SCRAM

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
-1

Possibility for connection through an SSH tunnel with Robomongo is back in the RC8 version. See GitHub issue Where is the SSH tunnel settings on v 0.9.0 RC2 Mac version #1008.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
YaTaras
  • 5,159
  • 1
  • 20
  • 15