Mongostead7 icon indicating copy to clipboard operation
Mongostead7 copied to clipboard

How to connect Robomongo

Open mistre83 opened this issue 8 years ago • 3 comments

Hi, thanks a lot for your script, it have successfully installed mongodb!

Now i'm trying to connect it with Robomongo.

I have made forward port on 27017 and 3000.

But, i'm not able to connect (i tried: 127.0.0.1, 192.168.10.10, localhost)... but nothing.

do you know how to solve this ?

mistre83 avatar Feb 03 '17 19:02 mistre83

I'm using SSH tunnel and it works without using port forwarding. I guess you can connect to MongoDB without authentication by default, but I like to set up auth anyway. To do that, connect to your mongo DB server:

mongo --port 27017

Then, select the admin database and insert new user:

use admin

db.createUser(
  {
    user: "admin",
    pwd: "admin",
    roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
  }
)

Now, open up Robomongo and make new connection, name it whatever you want and set hostname to localhost and port to 27017. Now switch to Authentication tab and set up auth database to admin, user name and password admin (or whatever you set in previous step) and auth mechanism to SCRAM-SHA-1. Switch to SSH tab and check Use SSH tunnel. SSH address 192.168.10.10 (your homestead IP address), user name vagrant and use password or private key (I prefer private key). If using private key set path to /Users/USERNAME/.ssh/id_rsa (this is path for OS X) and your passphrase. Save settings and voila - it works!

avramovic avatar Mar 31 '17 09:03 avramovic

Thanks @avramovic for the solution, if this helps @mistre83 i am closing this issue

zakhttp avatar Mar 31 '17 19:03 zakhttp

@zakhttp This works. I think you should close the issue.

dannysood avatar Apr 30 '17 15:04 dannysood