简体   繁体   中英

MongoError: Authentication failed. - trouble connecting to MongoLab

I am trying to connect to MongoLab (sandbox). I'm using MEAN.

I've put the development and production strings inside mongo={} in credentials.js file. But I'm not sure how to put database username and password. I can see my username and pass on MongoLab website, but I'm unsure of the format to use, can you please leave an example?

See the official documentation . The connection URI is formatted like this:

mongodb://<dbuser>:<dbpassword>@ds012345-a0.mongolab.com:56789/sample-db

You'll find the correct URI to your database on your admin page in Mongolab.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM