Error in connect to ATLAS

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

Error: connect failed to replica set atlas-xqpg05-shard-0/ac-ypvok0z-shard-00-00.w7njyxv.mongodb.net:27017,ac-ypvok0z-shard-00-02.w7njyxv.mongodb.net:27017,ac-ypvok0z-shard-00-01.w7njyxv.mongodb.net:27017 :
connect@src/mongo/shell/mongo.js:374:17
@(connect):2:6
exception: connect failed
exiting with code 1
user@M001#

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,
Kushagra

Thanks mr. Kushagra_Kesav!!
This the screen:
image

And this my string of the connection:

mongo “mongodb+srv://sandbox.w7njyxv.mongodb.net/Sandbox” --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://sandbox.w7njyxv.mongodb.net/Sandbox" --username m001-estudiante

Please let us know if you have any further questions

Best,
Kushagra

Hi!!
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 0.0.0.0/0 (which also includes your current IP address)

Please note 0.0.0.0/0 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.

Thanks,
Kushagra Kesav

1 Like

that´s ok!!
Tank’s
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.