1

I am creating a project using Webstorm with mongoose library installed. Developing on my localhost with mongodb, my connection string was:

database: "mongodb://127.0.0.1/mydatabase"

Everything works fine. I am trying to move it to the web using a mongolad db. I changed my connection string to the following:

database: "mongodb://myuser:mypass@dsXXXXXX.mongolab.com:XXXXXX/mydatabase"

I am getting an error in webstorm:

events.js:72
    throw er; // Unhandled 'error' event
          ^
Error: failed to connect to [chtr33:27017]

Removing the username and password does not throw the error, but of course I have no read/write permissions.

Azzabi Haythem
  • 2,318
  • 7
  • 26
  • 32
Jeffiec_c
  • 55
  • 7

2 Answers2

1

turns out you cant use the @ char in the password (facepalm)

Jeffiec_c
  • 55
  • 7
  • You can. You just need to connect a little differently as shown in http://stackoverflow.com/questions/7486623/mongodb-password-with-in-it – CodeWarrior Apr 14 '15 at 15:26
1

You can simply replace '@' with '%40' in password in connection string.

It worked for me, I hope it would work for you too.