My error goes :
mongo "mongodb+srv://cluster0-ts5b5.mongodb.net/test" --username admin-David
MongoDB shell version v4.0.6
Enter password: Cannot get console mode 6
I meant to write password there but I can't proceed to password so I can't connect to Atlas at all. Please sort this problem!!
*** You have failed to connect to a MongoDB Atlas cluster. Please ensure that your IP whitelist allows connections from your network. Error: can’t connect to new replica set master [ curso-plazi-shard-00-01.erhv8.mongodb.net:27017 ], err: AuthenticationFailed: bad auth : Authentication failed. :
Connect to Studio 3T Open Studio 3T and click on Connect in the top-left corner of the toolbar. This will open the Connection Manager. Click on New Connection in the top-left corner, which will open a new connection window. Name your connection and click on the From URI button. Paste the connection string you copied from MongoDB Atlas.
MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you 're trying to access the database from an IP that isn' t whitelisted.
However, the improper installation of client and problems with URI string may lead to MongoDB not connecting error. At Bobcares, we often get requests to fix MongoDB not connecting error as part of our Server Management Services. Today, we’ll see how our Support Engineers connect MongoDB via different methods and fix related errors.
I ran into this same problem today, I was able to log in by including the password in the same statement where the url and username are.
So in your case try doing this:
mongo "mongodb+srv://cluster0-ts5b5.mongodb.net/test" --username admin-David --password <yourPasswordHere>
That worked for me, hopefully it helps!
MongoDB docs reference: https://docs.mongodb.com/manual/reference/program/mongo/#cmdoption-mongo-username
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With