未经授权连接MongoLab上的Mongo DB?
我的问题:
有没有什么方法可以在没有用户名和密码的情况下连接到 Mongo DB(托管在 MongoLab 上)?
我的案例:
我创建了一个免费的 MongoLab 帐户(https://mongolab.com)并创建了新的数据库 ->收藏->里面的文档。
当我在没有用户名和密码的情况下连接到 Mongo DB(在 Mongo Lab 上)时,我能够连接,但是当我尝试检索任何数据时,它给我“未经授权的数据库:测试锁定类型:-1 客户端:....”错误。
因此,我也在 MongLab 中创建了一个数据库用户,并在连接时提供用户名和密码。之后我就可以连接 Mongo DB 并检索数据。
My Question:
Is there any way to connect to Mongo DB (hosted on MongoLab) without username and password ?
My Case:
I have created a free MongoLab account (https://mongolab.com) and also create new database -> collection -> document in it.
When I connect to Mongo DB (on Mongo Lab) without username and password, I was able to connect, but when I try to retrieve any data it gives me "unauthorized db:testing lock type:-1 client:...." error.
So I have created a DB User in MongLab as well and provide username and password at the time of connection. After that I am able to connect and retrieve data from Mongo DB.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MongoLab 的多租户数据库计划位于共享服务器上。我们不能让您选择放弃身份验证。即使您同意其他人看到您的数据,您共享的服务器上的其他租户仍然不希望您看到他们的数据。
我们有专用的服务器计划,您可以拥有自己的服务器。对于那些我们可以为您关闭身份验证。请发送电子邮件至[电子邮件受保护]。
至于你的基准测试 - auth 不会减慢速度。驱动程序不会对每个请求进行身份验证,而只会对每个连接进行身份验证。如果您正确使用驱动程序,它应该可以正常工作。
-将(MongoLab)
MongoLab's multi-tenant database plans are on shared servers. We cannot give you the choice to forgo authentication. Even if you were ok with others seeing you data, the other tenants on the server you share would still not want you to see their data.
We have dedicated server plans where you have your own server. On those we could turn off authentication for you. Email us at [email protected].
As for your benchmarks - auth will not slow things down. The drivers do not authentication on each request, just each connection. If you use the driver properly it should all work well.
-will (MongoLab)