title: Connecting to MongoLab database from localhost
body: <p>I am trying to connecting to a database created under my mongolab account.  I am running this subsequent code on localhost.  It runs for 10-20 seconds before giving me either this error: <code>[Error: failed to connect to [gmail.com&gt;:27017]]</code> or this error: <code>connection error: { [MongoError: auth failed] name: 'MongoError', ok: 0, errmsg: 'auth failed', code: 18 }</code></p>
  
  <pre><code>var mongoose   = require('mongoose');
  mongoose.connect('mongodb://&lt;myUserName&gt;:&lt;myPassword&gt;@ds011863.mlab.com:11863/myDBName'); // connect to our database
  
  var db = mongoose.connection;
  db.on('error', console.error.bind(console, 'connection error:'));
  db.once('open', function() {
    // we're connected!
    console.log('mongo connected!');
  });
  </code></pre>
  
  <p>Are there any inherent problems with attempting to connect to mongoLab's hosted DB's through localhost on port 8080?  I have been through much of mongoLab's trouble-shooting and cannot see what the cause of this error can be.</p>