Unable to connect to Mongo Atlas via Mongo Shell

Screenshot%20(109)

Hi @shubhamverma18,

Can you please make sure you are entering correct password?

Authentication failed error means either the username is incorrect or the password that you have entered is incorrect.

Hope it helps!

If you have any other query please feel free to get back to us. Happy Learning :slight_smile:

Thanks,
Shubham Ranjan
Curriculum Support Engineer

The credentials are correct.
I tried many times, even tried changing username password
Also tried creating new cluster but was getting the same error.
But the same credentials worked when connecting using Compass.

Hi @shubhamverma18,

That’s strange. Can you please share the credentials so that I can test it from my end?

Once done, I would recommend you to change the credentials.

Thanks,
Shubham Ranjan
Curriculum Support Engineer

username:shubhamverma18
pass: mongodbpass7

cluster is now:mongocourse

If I may add, the error message also says Please ensure that your IP whitelist allows connections from your network.

Hi @shubhamverma18,

I am able to connect to your cluster.

Please use the connection string mentioned below to connect to your cluster.

mongo "mongodb+srv://mongocourse-qdamx.mongodb.net/test"  --username shubhamverma18 -p mongodbpass7

However, if you are still unable to connect then please share the output so that I can debug the issue.

Hope it helps!

Thanks,
Shubham Ranjan
Curriculum Support Engineer

I tried your code and its still the same error.

You are not using the same password as the one you shared with us.

It looks like you have changed the password since @ Shubham_Ranjan tried. The new password seems to work as I was able to connect with

mongo "mongodb+srv://shubhamverma18:password7.@mongocourse-qdamx.mongodb.net/test"

Then why can’t I connect?
Is there firewall setting to change?

Try http://portquiz.net:27017 to see if you may go out from your station.

Those ping testes in the first chapter worked for me.

I would suggest to try from another location. If I can connect then your cluster is fine. There must be something from your current location that prevents you. I would also try with Compass.

1 Like

Strangely Its connecting with compass

Hi @shubhamverma18,

This is strange as you are able to connect from Compass.

I can verify that there is nothing wrong with your cluster or the settings as I and @steevej-1495 are able to connect to your cluster. The problem must be on your end.

Can you please try to connect from some other location such as you home network and see if that resolves the issue ?

Thanks,
Shubham Ranjan
Curriculum Support Engineer

What exactly do you mean here? You are able to connect via Compass on a different machine?

@007_jb Yes It is connecting via Compass on my PC and not through Shell

@Shubham_Ranjan
I only have my PC no other machine and just a single home network.

Update:
I tried using VPN and connecting via shell, and it got connected.

Now will it work if I turn off the vpn and use the cluster?

Peculiar @shubhamverma18!
Try disconnecting from your home network (wired and wireless), use your phone as a hotspot and connect using your phone’s network.