Lecture: Connecting to Your Sandbox Cluster from the mongo Shell different window and connection failed

image

It says bad authentication
Error is due to wrong combination of username and password
Please check your steps again.How you created the user and the pwd you registered while creating Sandbox cluster

Hi @Heba_41520,

The error message says that the authentication has failed. Please make sure that you are entering correct username and password.

If the issue does not get resolved then you can create a new user by following the instructions mentioned in the point 7 of the Lab 2.0: Create an Atlas Sandbox Cluster.

Try to connect using the credentials of the newly created user. If the issue still persists then please feel free to get back to us.

Thanks,
Shubham Ranjan
Curriculum Support Engineer

Yes it says authentication failed although I am sure I am using the right username and password. But I think this is because of the connection string

I only have the connection string not the connection command as said the course

image569897.png

Hi @Heba_41520,

I’m able to connect to your cluster using this connection string.

mongo "mongodb+srv://sandbox-xqboc.mongodb.net/test" -u m001-student -p m001-mongodb-basics

Are you able to ping and telnet your cluster ?

ping sandbox-shard-00-00-xqboc.mongodb.net

telnet sandbox-shard-00-00-xqboc.mongodb.net 27017

Thanks,
Shubham Ranjan
Curriculum Support Engineer

am not able o connect, am getting the following error in my CLI.

C:\Program Files\MongoDB\Server\4.2\bin>mongo “mongodb+srv://sandbox-mdyrl.mongo
db.net/test” --username m001-student --password m001-mongodb-basics
DNSHostNotFound: Failed to look up service “”:This operation returned because th
e timeout period expired.
try ‘mongo --help’ for more information

I am able to connect
Looks like you have malformed connect string
Make sure entire command fits in single line and try again
It should work

I worked,

Thanks a lot

image569897.png

Hi @Abhilash_19486,

Please use this connection string for connecting to your cluster.

mongo "mongodb+srv://sandbox-mdyrl.mongodb.net/test" --username m001-student --password m001-mongodb-basics

Let me know if the issue still persists.

Thanks,
Shubham Ranjan
Curriculum Support Engineer

i am getting the same error again.

C:\Program Files\MongoDB\Server\4.2\bin>mongo “mongodb+srv://sandbox-mdyrl.mongo
db.net/test” --username m001-student --password m001-mongodb-basics
DNSHostNotFound: Failed to look up service “”:This operation returned because th
e timeout period expired.
try ‘mongo --help’ for more information

There is no issue other than malformed string
Your command is going into two lines.Hence the error

Please try this.I can connect without any issues

mongo “mongodb+srv://sandbox-mdyrl.mongodb.net/test” --username m001-student --password m001-mongodb-basics

Hi @Abhilash_19486,

Please copy and paste this string in your command prompt and share the screenshot of it.

mongo "mongodb+srv://sandbox-mdyrl.mongodb.net/test" --username m001-student --password m001-mongodb-basics

Thanks,
Shubham Ranjan
Curriculum Support Engineer