Unable to connect to MongoLab "auth fails" error
Asked Answered
T

4

23

I am new to mongo. Recently created an account in mongoLab.

I am trying to connect to the database using the below statement.

mongo ds039487.mongolab.com:39487/webbies -u <dbuser> -p <dbpassword>

Getting the below error

MongoDB shell version: 2.4.8
connecting to: ds039487.mongolab.com:39487/webbies
Wed Dec 11 22:30:16.686 Error: 18 { code: 18, ok: 0.0, errmsg: "auth fails" } at src/mongo/shell/db.js:228
exception: login failed

Note: dbuser - is an User created in mongoLab

What is missing in this? Kindly advice.

Tien answered 11/12, 2013 at 17:6 Comment(2)
Typically this is due to mistakingly using your mongolab.com username and password, instead of the database username and password, but if that's not the case you should write into [email protected].Apache
Don't forget to Add Database user in mlab also i.sstatic.net/JymGw.pngElliott
T
33

Thanks to pneumee.

The issue was because I was using my mongolab.com username and password, instead of the database username and password.

It is working now.

Tien answered 12/12, 2013 at 2:52 Comment(1)
Excellent! Happy mongo'ing. :)Apache
F
44

Old thread, but just in case it helps anyone else: my problem was using shell version 2.4.9 to connect to mongo db version 3.0.7 (http://docs.mongolab.com/connecting/#mongo_shell).

Updating my shell sorted it (https://docs.mongodb.org/master/tutorial/install-mongodb-on-ubuntu/).

Frontwards answered 4/11, 2015 at 15:25 Comment(1)
this should be actual solution.Saleem
T
33

Thanks to pneumee.

The issue was because I was using my mongolab.com username and password, instead of the database username and password.

It is working now.

Tien answered 12/12, 2013 at 2:52 Comment(1)
Excellent! Happy mongo'ing. :)Apache
W
12

OK - I figured it out and would also like to add onto pneumee's answer.

  1. Go to mongolab.com
  2. Login.
  3. Navigate to the "Users" tab.
  4. If you have forgotten your Username and Password for the database, I suggest you "Add a new user" and supply it with the username and password.

db username and db password

Whitecap answered 23/4, 2015 at 18:55 Comment(0)
L
-6

default users in db

login: admin 
password: admin

check users in https://mongolab.com/databases/MYDBNAME#users

my problem was being putting login and password mongolab

Laundrywoman answered 20/5, 2014 at 11:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.