1

I'm working through the book "Getting MEAN," which is a MEAN stack tutorial. I'm creating a sample app and deploying to Heroku. I'm stuck at the point where I'm trying to push data from my local Mongo database to my mLab Heroku addon.

I was able to create the mLab database with no problem. Also created a mongodump in a temp folder. Then retrieved the mLab URI with:

heroku config:get MONGOLAB_URI

So far so good. Now the next step is to push the data from the temp folder up to the mLab database with this command (populated with real values from the MONGOLAB URI, of course):

mongorestore -h <DB server:port> -d <DB name>7 -u <username> -p <password> <path to temp folder>

But when I run that, I get:

Failed: error connecting to db server: no reachable servers

I searched through the documentation on mLab and Heroku and also the forum for the Getting MEAN book itself, and wasn't able to find anything helpful.

Thanks in advance!

Brian O'Neill
  • 4,705
  • 5
  • 22
  • 26

1 Answers1

4

I had the same problem (also while following 'getting MEAN' and I solved it by taking the database name out of the host name: When you get the MONGODB_URI, just after the @ you get the host name with the database name slashed after it. That was the cause of the problem in my case.

Ran Levy
  • 135
  • 9