I'm using robomongo tool to access mongodb. When I connect into my db then
Show error details
How to fix it?
I had the same issue and was able to fix it by removing the full url (for example: mongodb://myuser:mypassword#mongodb-test.mydomain.com/my_database) in the connection tab and only putting in the mongodb server url: mongodb-test.mydomain.com.
Next, in the Authentication tab, I checked the Perform authentication checkbox, specified the Database, user name, password.
I also added the database in the Advanded tab just in case and I can now connect without error.
Try inserting only e.g: ds12345.mlab.com at address bar instead of full [http:// mongodb://<dbuser>:<dbpassword>#...] and create user to authenticate in mlab.com and then try connect to it. Something like this:
And then:
Whilst this answer is only partly related to the problem, I want to describe the solution in here.
I had this problem when trying to connect via Robo3T to a cluster of MongoDBs hosted on Atlas. They offer a connection string with the protocol in front (e.g. mongodb+srv://<USER>:<PASSWORD>#database-mongodb.net/admin). This was a combination of two problems:
Robo3T does not like the protocol mongodb+srv:// in the URI. You should use only the second part (after the #). Like: database-mongodb.net.
Robo3T does not like shards. At least I could not get to connect with it via that connection string. Fro what I understand, you need that protocol to connect to a shard. Since you can't use that kind of URI, you will need to connect directly to the primary shard. To do that, you need to build a new connection string with the URI of the primary shard. Like this: database-shard-00-00-vemhh.mongodb.net and provide the port to Robo3T. Also, you need to connect via SSL, if you're using MongoDB Atlas (a self-signed certificate configured directly in Robo3T worked for me).
Remove only [http://] worked for me
Get the newer version of the Robo3T client...it can import it automatically from +srv link
I was facing the same problem, but I can solve it by installing Robo 3T 1.3 and import connection details from MongoDB SRV connection string. See this:
Steps to connect remote DB from Robo 3T 1.3
Remember to replace the user in the connection string and the pass at Authentication Tab
The connection string in the picture is dummy by the way
Related
I'm new to MongoDB and I'm having some problems with MongoDB recently.
I'm not sure about Connect with the MongoDB Shell, Connect your application, Connect using MongoDB Compass, what's the difference?
The current demand is. I want to directly allow connection from anywhere and create a user account password to log into this database, which option should I choose?
https://i.stack.imgur.com/iwYMf.png
In Connect your application tab, you get a link that you need to copy
and paste in your application you are building to connect it to the
database. Remember to replace your password and databse name.
In Connect using MongoDB Compass tab, you get a link that you need
to paste in your compass application(A desktop application that
makes your mongodb data handling so much easier). And again remember to replace
your credentials.
I'm not very fond of Mongodb shell. It's actually an extensible
command-line interface.
I try to connect with MongoDB Compass via ssh tunnel.
It worked before but now when I do it, it always connects to my local MongoDB instance instead of my remote one. Please have a look at the pictures below which show my settings. pretty sure it was also before like this but somehow now it connect to the wrong DB. When I connect manually via ssh (using exactly those credentials) I can see that the data is different.
What am I missing here?
connection
connection2
Via shell, I can directly connect to mongo database with this string
mongo --ssl host1,host2:port/MyDataBase...
And I land directly on the MyDataBase.
Is there a similar way to do it in Compass? I get connected to whole server and I can see all the other databases. I just want to connect to MyDataBase.
I am using the lattest version of Compass, so it may differ from your current version.
It is important the you are in the network of the server, or use a VPN connection, otherwise, it does not work.
Step 1
Step 2
Please,let me know if that works!
Every time I try to connect to MongoDB Atlas cluster, Compass gets stuck in some never-stop-loading bug.
There is no error of any kind, not even in dev-tools.
If I try to connect to localhost, everything works fine.
Atlas connection string is never recognized automatically, if that means something.
I need to paste it manually, and after I click connect, white overlay is shown and that's it.
I disabled firewall, reinstalled mongoDb from my computer, tried to restart service couple of times ...nothing helps.
White overlay after clicking on connect:
ps. I have a cluster created, with mongoDB user and white-listed my IP.
pps. compass version is 1.20.5, windows 10
Sorry I just figured it out.
You need to go to "Connect" in Atlas, go to "Connect Your Application" (NOT "Connect with MongoDB Compass")
Change Node.js version to "2.2.12 or later"
Copy connection string as normal, replace password and paste in Compass
Edit: I've come up with even more details - the underlying problem could be your DNS. Try to replace it with the Google DNS for example (8.8.8.8) to see if it fixes the issue and continue using the up-to-date connection string.
It could be a permissions thing, try running as administrator.
I would recommend:
Uninstalling/Installing the latest MongoDB Compass version
Double checking workstation authorizes MongoDB port outgoing requests (27017 by default, but it shouldn't be needed as you disabled your firewall)
Double checking your IP address is indeed in the IP whitelist (that would be my first guess)
Double checking your user has read permission in the cluster
Double checking the connection string, in MongoDB Atlas click on "Connect", indicate Atlas and copy/paste
For the IP whitelist, just to be sure you can check it by going to MongoDB Atlas https://account.mongodb.com/, click in the left column on Security > Network
Then double check your IP is here (it will be indicated), otherwise click on "Add IP address".
I am using the 4.4.6 version
Following these steps may help you,
Network access : 0.0.0.0/0 (or your personal IP)
Database access : readWriteAnyDatabase
Choose connect to your application
you will get a string like :
mongodb+srv://admin:#sickcluster.a87o5.mongodb.net/myFirstDatabase?retryWrites=true&w=majority
change the admin, Password with brackets<>, and myFirstDatabase values {database name is optional}
now paste this URL in your MongoDb compass and application
This question is specific to MongoVUE, but really I am looking to be able to log in to Mongo on EC2 in any way besides through the SSH tunnel. I can do that and get a server and client up and running, create documents, find things etc. I am new to mongo and ec2 so I will admit there are a lot of variables.
Here is what I've done so far:
I have created a unique database and then added a user to that with the db.addUser('name','password') command.
I am using the public dns that AWS provided which looks like, xxxx.us-west-1.compute.amazonaws.com
I have tried to log in with the plain text password as well as the one mongo displays (hashed).
My ultimate goal is to be able to connect through C#, but MongoVue gives me an easier platform to fiddle around with (I hope).
Any help would be great! Thank you.
I was trying to do the same thing and it actually ended up being pretty easy after following the instructions on Mongovue's Blog
http://www.mongovue.com/2011/08/04/mongovue-connection-to-remote-server-over-ssh/
This allows you to not have to open up the MongoDB port externally also.
Make sure you also convert your EC2 .pem key to a Putty Key via PuttyGen first.
Okay, I solved it for those of you that will find this question and be in the same boat. For some reason I could not change my security group on ec2 to the one I had given access to port 27017. So I added that port exception to the security group that was currently assigned to my instance.
I then had to log in through SSH to get the Mongo server up and running (simply run the mongod command in the bin directory) and then it logged right in. I used the username and password that I had set up earlier through the mongo command line.
I hope this helps someone.