I am getting error “Could not connect to MongoDB on the provided host and port” while try connecting to Mongo Compass. I have tested the firewall restriction and it’s working fine. However, I am not able to access Mongo Compass.
If your ping is working fine that you means you can access the host (cluster0-shard-00-00-jxeqq.mongodb.net), but there is problem connecting to 27017 port, please check on clicking this. It should show something like this:
Outgoing port tester
This server listens on all TCP ports, allowing you to test any outbound TCP port.
You have reached this page on port 27017 .
Your network allows you to use this port. (Assuming that your network is not doing advanced traffic filtering.)
It looks like you are trying to access MongoDB over HTTP on the native driver port.
If you are still not able to connect, please check if this port is getting used by any other application. Make the port 27017 free and restart Compass and try logging in again.
I believe so. However, I have tested using other port on PowerShell and it’s successfully.
However, when I trying to connect using compass, it’s not able to connect.
Hi @Kanika
I am getting following error
“An error occurred while loading navigation: ‘not master and slaveOk=false’: It is recommended to change your read preference in the connection dialog to Primary Preferred or Secondary Preferred or provide a replica set name for a full topology connection.”
Kindly help me
Thanking you in advance
I am seeing the same problem. I’ve checked the connection details three times and they match those specified in the lecture notes. Compass shows me a list of DBs down the left hand side, but clicking on them only repeats the message that @Reyaz_46528 is reporting. I have disconnected and reconnected multiple times.
Thank you. I think these are the same details shown in the lecture notes, but they are working from me now.
I was getting the same error, but then I completely exited Compass and opened it again, and now I can see the databases and their contents.
Which version you are using
Is connection working from mongo shell
Rule out all possibilities IP whitelist,anti virus,firewall,port block etc
Did you try from another location or machine
Are you trying from office or home?