Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't Connect to Mlab

I have a very simple Mlab account and I'm trying to connect via command line with this command:

mongo server_name.mlab.com:port/inventory -u <dbuser> -p <dbpassword> 

but I keep running into this problem:

2016-05-26T15:41:18.195+0200 Error: 18 { ok: 0.0, errmsg: "auth failed", code: 18 } at src/mongo/shell/db.js:1210 exception: login failed

How do I get rid of this and how can I connect to mlab easily?

like image 483
xupv5 Avatar asked May 26 '16 13:05

xupv5


People also ask

Can't connect to MongoDB?

These are some of the solutions: Ensure that your MongoDB instance is running: Compass must connect to a running MongoDB instance. Also check you have installed MongoDB and have a running mongod process. You should also check that the port where MongoDB is running matches the port you provide in the compass connect.


1 Answers

I think that you're using your mLab credentials. You must set a DB User at the User Tab like this:

Add Database user

like image 127
Rafa Barragan Avatar answered Oct 18 '22 15:10

Rafa Barragan