2

I have created a mlab database. But I am unable to export it to meteor application.Everytime I try to connect, it throws an error "mongoError: failed to connect to server [ds035693.mlab.com:35693] on first connect".Command I am using is

"export MONGO_URL= mongodb://<dbuser>:<dbpassword>@ds035693.mlab.com:35693/abcd"

Community
  • 1
  • 1
dpatnaik
  • 188
  • 1
  • 16

2 Answers2

0

You need to create a database user in mLab, with an id and password.

Then your MONGO_URL should like:

mongodb://<id>:<password>@ds035693.mlab.com:35693/abcd

Note that it is NOT your account credentials.

ghybs
  • 47,565
  • 6
  • 74
  • 99
  • Thanks. I have already tried mongodb://:@ds035693.mlab.com:35693/abcd, but still does not doesn't work. – dpatnaik Apr 07 '17 at 07:29
  • Are you replacing `` and `` by what you have set for your DB user? – ghybs Apr 07 '17 at 07:31
  • Then you need to share much more details about your setup, how you start meteor, and the error(s) you get, should you need any further help. – ghybs Apr 07 '17 at 07:43
0

i think you don't need " " around your export. just put this in your terminal

export MONGO_URL= mongodb://<dbuser>:<dbpassword>@ds035693.mlab.com:35693/abcd

replace with your id and password.

and console.log(process.env); in your startup function to check if MONGO_URL is set or not. if this is set. this may be your network issue.

you may be forgot to add database user in user tab for your collection in mlab.

hope this will help

Amit kumar
  • 6,029
  • 6
  • 30
  • 40