Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MongoDB remote connection via RoboMongo

Tags:

mongodb

robo3t

I'm trying to connect to my Mongodb server via Robomongo.

I have changed the Bind_ip to 0.0.0.0 at the server mongod.conf I have also set the auth=true field.

Now when I'm trying to log in from RoboMongo I'm getting auth fail error.

To be honest i have no idea what is the user name or password (I didn't set any user after installing Mongo, and i prefer not to because I'm using nodeJs to query the db and when i try to log in I'm getting auth fail as well [thats with mongoskin])

Does Mongodb have default user name or password? or what else can I do?

like image 578
tubu13 Avatar asked Jan 06 '15 18:01

tubu13


People also ask

How do you create a connection on RoboMongo?

Start robomongo. When the "MongoDB Connections" window appears, click on Create button. This will popup a new "Connection Settings" window. Enter a friendly "Name" for this mongoDB connection.


1 Answers

Does Mongodb have default user name or password?

There are no default users created by MongoDB, however if you have just enabled authentication and haven't created your first user yet (which should be a user administrator), then you have to connect via localhost to set up up the initial user. There is a localhost exception enabled by default to specifically to allow creation of the first user with auth enabled. Remote connections will not be able to authenticate without valid user credentials.

After you have created the required user(s), you should then be able to login remotely with those credentials using Robomongo or another interface like the mongo shell or your mongoskin app.

If you don't want to use the localhost exception an alternative approach would be to start your MongoDB server with auth disabled, add the required users remotely, and then restart the server with auth enabled.

like image 58
Stennie Avatar answered Sep 27 '22 22:09

Stennie