0

I found out my website wasn't working anymore because i can't auth to my mongolab DB.

here is my code (it used to work for months):

var mongoose = require('mongoose');
mongoose.connect('mongodb://USER:PASSWORD@ds053419.mongolab.com:53419/jobinfest', 
    function(err) {
        console.log(err);
        if (err) { throw err; }
    }
);

I have this error:

{ [MongoError: auth failed] name: 'MongoError', ok: 0, errmsg: 'auth failed', code: 18 }

But i can access the db via mongolab and :

mongo ds053419.mongolab.com:53419/jobinfest -u USER -p PASSWORD

I tried to create new users, even a new db. This way of connection seems to not work anymore

Alireza
  • 2,319
  • 2
  • 23
  • 35

1 Answers1

-2

In your code be sure you are replacing USER:PASSWORD with your actual username and password.

    mongodb://USER:PASSWORD@ds053419.mongolab.com:53419/jobinfest
sschrass
  • 7,014
  • 6
  • 43
  • 62
Mike
  • 11