Connecting to monogdb with string using MUP


#1

I’m trying to connect my app to MongoDB using MONGO_URL: in MUP. The database is on an independent VPS. The VPS is behind a firewall and is connected to the app VPS via a private network. If I don’t secure the database with a username and password I can get it to connect however if I create a user to allow readWrite commands to add security it wont connect. I get this error.

MongoError: failed to connect to server [private-network-ip:27017]

If I log into the database and use show dbs this is what appears:

admin         0.000GB
myspecial_db  0.000GB
local         0.000GB

I’m trying to access the myspecial_db.

MONGO_URL: mongodb://username:password@private-network-ip:27017/myspecial_db

What am I missing here?


#2

Not too much info to go on but if I had to guess I’d say mongo was not accesable on the public ip OR the user/password combination does not have appropriate access privileges for the database you are trying to connect to. You may have to specify the authentication database in the url


#3

No, if authorization fails you get a different error message.


#4

Sorry. It turns out it was due to my firewall and private network setup.


#5

Hi all, Now I have the same problem.
I would like to connect monogdb on digigtalocean (Mup) from local other apps

MONGO_URL: mongodb://dbusername:dbuserpassword@private-network-ip:27017/myspecial_db meteor

Get the same error