title: how can I connect to a remote mongo server from Mac OS terminal
body: <p>I would like to drop into the mongo shell in the terminal on my MacBook.  However, I'm interested in connecting to a Mongo instance that is running in the cloud (compose.io instance via Heroku addon).  I have the name, password, host, port, and database name from the MongoDB URI:</p>
  
  <pre><code>mongodb://username:password@somewhere.mongolayer.com:10011/my_database
  </code></pre>
  
  <p>I have installed mongodb on my MacBook using Homebrew not because I want Mongo running on my Mac, but just to get access to the mongo shell program in order to connect to this remote database.</p>
  
  <p>However, I can't find the right command to get me the full shell access I would like.  Using instructions found here <a href="http://docs.mongodb.org/manual/reference/program/mongo/">http://docs.mongodb.org/manual/reference/program/mongo/</a> (search for "remote") I am able to get what looks like a connection, but without giving my username or password I am not fully connected.  Running <code>db.auth(username, password)</code> returns 1 (as opposed to "auth fails" when I provide incorrect username and password), but I continue to get an "unauthorized" error message when issuing the <code>show dbs</code> command.</p>