Unable to connect to MongoDB compass

Unable to connect to MongoDB compass.
Error message says “Could not connect to MongoDB on provided host and Port”

Hi there,

Could you please provide us with a screenshot of your connection criteria in the Compass UI?

Thanks,
Barry

I am able to connect
Are you able to connect from mongo shell?
Please check this

About the Chapter 1: Compass Connection [Solution]

I noticed that you have not checked the SRV Record option in the Compass UI.

Atlas uses DNS SRV records to simplify the connection string when connecting to a replica set.

Please check this option and try again.

Barry

@barryoneill
Hi, I am also facing same issue, even after checking the SRV Record option, it is showing another error MongoDB not running on the provided host and port .

Hi KodeKracker,

I see you have pasted host twice in your Hostname textbox. Secondly, if you have SRV on, use this string in your host please: “cluster0-jxeqq.mongodb.net”.

Kanika

1 Like

Thanks @Kanika for pointing out the error in typing value in Hostname field. :relieved:
It is workin now even for host value cluster0-shard-00-00-jxeqq.mongodb.net as given in
Chapter 1: Introduction - Lab 1.1: Install Compass and Connect

1 Like

Unable to connect, attaching the screenshot
image

Hi @Praveen_61728,

Please try switching off the SRV Record field.
If you still face this issue, please refer to the following post:

I hope it helps!!
Please let me know, if you still face any problem.

Thanks,
Sonali