Error in connect to ATLAS

Helpme please with this error when traying connect to the ATLAS MONGO:

Error: connect failed to replica set atlas-xqpg05-shard-0/,, :
exception: connect failed
exiting with code 1

Hi @Jose_Juan_Cruz,

Welcome to the MongoDB Community forums :sparkles:

Could you please share the screenshot of the error with your srv connection string? It would be helpful for us to understand the error.

Meanwhile, you can refer to our M001 - FAQ post.


Thanks mr. Kushagra_Kesav!!
This the screen:

And this my string of the connection:

mongo “mongodb+srv://” --username m001-estudiante

Hi @Jose_Juan_Cruz,

I suspect you haven’t whitelisted the IP address in the MongoDB Atlas. Please follow the steps from here M001: Frequently Asked Questions.

Also use mongosh instead of mongo(as it’s deprecated).

mongosh "mongodb+srv://" --username m001-estudiante

Please let us know if you have any further questions


Thanks for your help bot… show same error

Hi @Jose_Juan_Cruz,

Could you try the below mentioned solution and see whether it works or not.

Go to your IP Access List under the Security->Network Access menu within your Atlas Cluster and add (which also includes your current IP address)

Please note is not recommended for your production environment as it allows access from anywhere around the globe.

In case you have any doubts, please feel free to reach out to us.

Kushagra Kesav

1 Like

that´s ok!!
My connection is ok and understand this point in my production enviroment!!
i’am learning in this laboratory only.

thanks you very much

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.