Mongodb & Robomongo: Can't connect (authentica

2019-01-11 11:13发布

问题:

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.

Same goes for...

Database: mydb
User Name: root

Database: mydb
User Name: mydbDbOwner

回答1:

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 :)



回答2:

Robomongo 0.8.x doesn't have support for the new SCRAM-SHA-1 authentication which is the default in MongoDB 3.0. This is being worked on as part of the Robomongo 0.9.0 release (see: issue #766).

If you are using the default MMAP storage engine (and not WiredTiger, which also requires driver updates) there is a possible workaround described on the Robomongo issue -- downgrading to the older MONGODB-CR authentication format.

There are also other data management UIs, some of which have already been updated with MongoDB 3.0 support.

For alternatives see:

  • MongoDB Tools - community site
  • Admin UIs - MongoDB manual


回答3:

You can try the Mongo-Express (a web-based tool). It is available here: https://github.com/andzdroid/mongo-express

However, you need to upgrade the mongodb-nodejs library to be at least (1.4.29) according to this: http://docs.mongodb.org/manual/release-notes/3.0-scram/

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

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

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

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

Run: npm update

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



回答4:

You can change localhost to 127.0.0.1



回答5:

For anyone who comes along this question, i just upgraded to the new 1.0 for Robomongo. As a few people stated in here 0.8.x didnt support SCRAM-SHA-1, which is default in mongodb 3.0 prior versions it was MONGODB-CR. But anyone who is downloading Robomongo from this point on shouldnt 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 https://docs.mongodb.com/manual/core/security-scram-sha-1/



回答6:

Possibility for connection through SSH tunnel with Robomong is back in the RC8 version. See github issue



标签: mongodb