[英]MongoError: Authentication failed. - trouble connecting to MongoLab
I am trying to connect to MongoLab (sandbox). 我正在尝试连接到MongoLab(沙盒)。 I'm using MEAN.
我正在使用MEAN。
I've put the development and production strings inside mongo={} in credentials.js file. 我已将开发和生产字符串放在mongo = {}中的credits.js文件中。 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?
我可以看到我的用户名并通过MongoLab网站传递,但是我不确定使用的格式,请您举个例子吗?
See the official documentation . 请参阅官方文档 。 The connection URI is formatted like this:
连接URI的格式如下:
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. 您可以在Mongolab的管理页面中找到数据库的正确URI。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.