title: Auth failed error when specifying database
body: <p>I'm trying to connect to a <code>mongodb</code> from my web application. However, I get an <code>auth failed error</code> from mongo when I specify the database I want to connect to. If I do not specify the db, then to connection is successful. </p>
  
  <p>I have checked the spelling and if the database exits with the mongo command line <code>show dbs</code>     </p>
  
  <pre><code>var dbURI = 'mongodb://root:pwd@localhost:27017/dbname';
  mongoose.connect(dbURI, function(err) {
      if (err) throw err;
  });
  
  C:\Users\David\Documents\Bitbucket\productWebsite\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\base.js:245
          throw message;
                ^
  MongoError: auth failed
      at Object.toError (C:\Users\David\Documents\Bitbucket\productWebsite\node_modules\mongoose\node_modules\mongodb\lib\mongodb\utils.js:114:11)
      at C:\Users\David\Documents\Bitbucket\productWebsite\node_modules\mongoose\node_modules\mongodb\lib\mongodb\db.js:1130:31
      at C:\Users\David\Documents\Bitbucket\productWebsite\node_modules\mongoose\node_modules\mongodb\lib\mongodb\db.js:1847:9
      at Server.Base._callHandler (C:\Users\David\Documents\Bitbucket\productWebsite\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\base.js:445:41)
      at C:\Users\David\Documents\Bitbucket\productWebsite\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\server.js:478:18
      at MongoReply.parseBody (C:\Users\David\Documents\Bitbucket\productWebsite\node_modules\mongoose\node_modules\mongodb\lib\mongodb\responses\mongo_reply.js:68:5)
      at null.&lt;anonymous&gt; (C:\Users\David\Documents\Bitbucket\productWebsite\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\server.js:436:20)
      at emit (events.js:95:17)
      at null.&lt;anonymous&gt; (C:\Users\David\Documents\Bitbucket\productWebsite\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\connection_pool.js:201:13)
      at emit (events.js:98:17)
  </code></pre>
  
  <p>I'm using Bitnami Mean stack for Windows</p>
  
  <p>Can someone tell me what I am forgetting?</p>