I have database hosted on MLab and I am trying to connect it with Compass. I am using host and port given in connection string but it is showing error, here is my screenshot:
What am I doing wrong?
I have database hosted on MLab and I am trying to connect it with Compass. I am using host and port given in connection string but it is showing error, here is my screenshot:
What am I doing wrong?
Had same problem manage to solve it like this:
A. Go to your db in mlab and in the tab choose "users"
B. Create a new user ex: username: admin
password: 123456
C: Go to compass and fill it this way
ds012345.mlab.com:56789/myDBname
hostname
ds012345.mlab.com
port
56789
authentication: username /password
admin // or the name of the user you created in step A
123456 // or password for the user you created in step A
authentication database
myDBname // the name of your database in mlab
I just had the same problem.
I fixed it by updating my version of MongoDB Compass. No problems encountered with version 1.15.4.
Also, Authentication Database should not have the value "admin" but the name of the DB to connect you.
To make your connection easier, don't hesitate to copy your entire connection string into the clipboard. Compass detects it and proposes to automatically fill in the connection form.
The problem that I had was the Authentication Database
Compass filled in automatically wasn't correct for my setup. By default, this was pointing to admin
but it needs to point to the database that the user is associated with.
Summed up: The database of admin
didn't exist.
Just to rule it out, double check what database you're pointing to. It should be in the name, like ds739176/database_name
where database_name
is, you guessed it, the name of your database.
Hope this helps.
The required credentials are not your login credentials to MLab, instead these are database user credentials.
click on your DB on MLab.
go to users tab and create new user.
use the created users credentials to access db.
set authenticationdatabase to be your database.
I had the same problem. MongoDB url was working in code but Authentication failed
was showing in MongoDB Compass.
When I checked, my mongodb password was iam%40me1234
.
Here I'm using %40
HTML hex code in the password for @
character.
So, If we will use the original character in the password like iam@me1234
in MongoDB Compass then it will work great.
Here is a full list of Hex codes
What I did:
I hope this will help you.
© 2022 - 2024 — McMap. All rights reserved.