본문 바로가기

DB/MongoDB

[MongoDB] Error at connecting to MongoDb Atlas Server

 

*** It looks like this is a MongoDB Atlas cluster. Please ensure that your IP whitelist allows connections from your network.

 

I was able to solve it by adding my white-listing my IP address under Clusters -> security -> IP Whitelist. Instead of clicking my current ip address, just search what's my ip on google and paste that instead.

I have had this issue connecting to a MongoDB Atlas cluster. I have had to resolve this issue twice because I was working on a project from two different computers (a Macbook Pro and a Windows PC).

Here is my comprehensive answer for everything that I have figured out to resolve the issue of my application not connecting to the cluster.

First Make sure your IP is whitelisted like the above suggestions. The easiest solution is the "All IPs" whitelist of 0.0.0.0/0

Second Check your VPN if you are using one. I was trying to connect to the cluster while connected to a VPN. Once I turned off my VPN, I was able to connect.

Third Make sure your internet settings are not preventing you from connecting to the cluster. My home Xfinity wifi security settings were set too high and this was preventing the connection. I think the router was not allowing a connection to port 27017. One way to test if this issue is occurring is to tether your computer to your phone for internet instead of your wifi and try connecting. I was able to connect using my iPhone as a hotspot for internet. I reset my router to factory settings which fixed the issue.

 

 

<Second Error> can't connect to new replica set master AuthenticationFailed: bad auth Authentication failed.

MongoError: bad auth Authentication failed

 

Step1. select your username and and click to edit from right side.

Step 2. click to change password.

Step 3. click update user.

 

References

https://stackoverflow.com/questions/49894913/error-at-connecting-to-mongodb-atlas-server/55665459

 

Error at connecting to MongoDb Atlas Server

So I'm currently wirting a web application and I need database so I decided to go with mongodb and mongoose. Until now I tested everything on localhost and it worked but I wanted to move the data t...

stackoverflow.com

https://stackoverflow.com/questions/55695565/error-message-mongoerror-bad-auth-authentication-failed-through-uri-string

 

Error Message: MongoError: bad auth Authentication failed through URI string

Very new to MongoDB and Node.js. I'm trying to connect to my mongoDB server via the connection string given to me by mongo: "mongodb+srv://david:password@cluster0-re3gq.mongodb.net/test?retry...

stackoverflow.com

 

'DB > MongoDB' 카테고리의 다른 글

[Nodejs/MongoDb] MongoDb 연결해서 데이터 불러오기  (0) 2020.03.01