Error while connecting MongoDB ATLAS TO MONGODB COMPASS

I am a beginer in mongoDB and learning Mongodb atlas.

  • In MongoDB Atlas, Under database access created username and password ( password is system generated and has no special character)
  • Under Network access added a public ip address (allow access from anywhere)
  • Under database deployment loaded sample database.
  • Now I wanted to see my cluster data, so wanted to connect it to vs code or MongoDB Compass. I clicked connect , selected connect using mongo db compass, copied the string.
  • now i opened Mongodb compass, and under New connection i.e connect to a MongoDB deployment , i entered my URLmongodb+srv://
  • clicked Connect But i got error as : Unable to connect: connect ECONNREFUSED

How I can fix it, Looking for kind help. Thanks in advance

This is not a valid cluster.

Ensure that you whitelist your ip address under Network Access → Add IP address

Simple reason is MongoDB atlass only allow connections from trusted IP addresses

This is a system generated, how can I fix it.

I tried adding my current ip address under network access, but still facing the same issues. And another way to whitelist ip address is to do it under security tab but security tab is not available for free community version. Looking for kind help.

You must have a typo in the name.

There is no DNS entry for the name

Thank you sir but sir i generated another url mongodb+srv://
but still facing the same issues.

This one is correct:

id 36076
opcode QUERY
flags QR RD RA
;ANSWER 60 IN TXT "authSource=admin&replicaSet=atlas-122qwu-shard-0" 60 IN SRV 0 0 27017 60 IN SRV 0 0 27017 60 IN SRV 0 0 27017

Now allow network access from everywhere.

yes sir i allowed access from anywhere

may you please check whether this works for you, it is still not working for me, i can connect to local server which works well but cloud isn’t working

I works fine now.

May be your VPN, ISP stops you from going. What do you get when you try

this is the error i am consistently getting sir

ISP, VPN or firewall is blocking you.

yes sir may be, when i clicked your link, it says site is not reachable.

Thank you so much sir for kind help, i will try to fix ISP, VPN or firewall, though not sure how to do it. thanks a lot.

1 Like

For now, change the password you shared.

sure sir, i’ will change it.