Published on

Fix: "Username containing an unescaped at-sign Issue" in MongoDB

Authors

Getting issue when connecting to your MongoDB using mongoose or some other ORM?

Well, it turns out your password has @ or another unsupported character in it.

We need to escape that password. In our case, it’s @ in the password.

Just replace @ sign to %40 (in your password string)

For example:

Before

mongodb://username:password**@**@example.com:25010/db

After escaping

mongodb://username:password**%40**@example.com:25010/db