问题
I created a new cluster in MongoDB Atlas but I can't connect to it thru the mongo shell.
C:\git_symphony\esp8266\SymphonySocket>mongo "mongodb+srv://<clustername>-gy7bf.azure.mongodb.net/test" --username <USERNAME>
DNSHostNotFound: Failed to look up service "":No records found for given DNS query.
try 'mongo --help' for more information
I tried switching regions but it didn't work. I've also tried using Compass on my mac but it just loads indefinitely when I try to connect. What could possibly be wrong?
回答1:
- Have you whitelisted your IP address ? IP whitelisting is important otherwise it will not connect.
- Have you created this cluster recently and is it in the europe region ?
- Is the cluster properly deployed or you are experiencing any issue in the deployment of the cluster ?
回答2:
Turns out, my ISP blocks all connections to MongoDB for some reason. I haven't contacted them yet, but I find this very silly as I racked my brains out trying to solve this when the problem wasn't at all in my control.
来源:https://stackoverflow.com/questions/60784313/cannot-connect-to-mongodb-atlas-cluster-dnshostnotfound