Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I'm trying to connect to mongodb Atlas but I keep getting error and can't proceed

Tags:

mongodb

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!!

like image 749
David Cho Avatar asked Feb 21 '19 02:02

David Cho


People also ask

Why can’t I connect to MongoDB Atlas cluster?

*** 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. :

How do I connect Studio 3T to MongoDB Atlas?

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.

Why am I getting mongooseserverselectionerror on 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.

Why is MongoDB not connecting?

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.


1 Answers

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

like image 148
Alex Abbott Avatar answered Nov 15 '22 11:11

Alex Abbott