I would like to peek into the mongo shell in the terminal on my MacBook. However, I'm interested in connecting to a Mongo instance that runs in the cloud (compose.io instance via the Heroku hadron). I have a name, password, host, port and database name from MongoDB URI:
mongodb://username:password@somewhere.mongolayer.com:10011/my_database
I installed mongodb on my MacBook using Homebrew, not because I want Mongo to work on my Mac, but just to access the mongo shell program to connect to this remote database.
However, I cannot find the right command to get me full access to the shell that I would like. Using the instructions found here http://docs.mongodb.org/manual/reference/program/mongo/ (search for "remote") I can get what looks like a connection, but without specifying a username or password I'm not completely connected . Running db.auth(username, password) returns 1 (unlike "auth fail" with an incorrect username and password), but I continue to receive an "unauthorized" error message when I issue the show dbs command.
mongodb mongo-shell
jononomo Nov 08 '14 at 4:52 2014-11-08 04:52
source share