rmongodb身份验证始终失败 [英] rmongodb authentication always fails

查看:158
本文介绍了rmongodb身份验证始终失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用rmongodb登录,但它不进行身份验证.这是我的连接字符串:

I'm trying to login using rmongodb and it does not authenticate. Here's my connection string:

myMongoConnection <- mongo.create(host = "<myip>",db = "geoLoc", username = "<myusername>", password = "<mypassword>")

但是,如果我在计算机上打开mongo shell并键入:

However, if I open a mongo shell on my computer and type:

mongo <myip>/geoLoc -u '<myusername>' -p '<mypassword>'

连接很好.

此外,如果我登录服务器并通过注释掉来禁用身份验证,请执行以下操作: auth = true,然后尝试:

Moreover, if I log into the server and disable authentication by commenting out: auth = true, and then try:

myMongoConnection <- mongo.create(host = "<myip>",db = "geoLoc)"

它也可以正常工作.因此,这与用户名和密码有关.我不知道该怎么办,因为我知道它们是正确的",因为我可以用它们登录!

it also works fine. So this is something to do with the username and password. I have no idea what though as I know they are "correct" as I can login with them!

推荐答案

您可能正在运行服务器版本的MongoDB 3.0或更高版本(当前为撰写本文的3.x系列),该服务器版本具有

You are likely running a server version of MongoDB 3.0 or above ( 3.x series current as writing ), which has an updated security authentication mechanism ( SCRAM-SHA-1 from MONGODB-CR ) that is not compatible with older driver versions that do not support it.

截至当前 rmongodb 软件包发行版(写作的版本1.8.0),此驱动程序基于与新的身份验证方法不兼容的旧版C驱动程序实现上.正如在该存储库上的问题中所指出的那样,作者注意到了该驱动程序的依赖性并指出该软件包需要重写才能利用支持新身份验证方法的新API.

The as of current rmongodb package release ( version 1.8.0 of writing ), this driver is based on the legacy C driver implementation which is not compatible with the new authentication methods. As is also noted in the issues on that repository, the author notes this driver dependency and states that the package would require a rewrite to utilize the new API that supports the new authentication method.

在撰写本文时,除了建立

As of writing, there does not appear to be any moves to make any such changes, aside for establishing a new branch which is not presently ready for release.

因此,您当前的选择是:

Your options therefore presently are:

  • 在没有身份验证的情况下工作
  • 将MongoDB服务器版本降级为支持旧身份验证的版本
  • 寻找支持新身份验证的其他驱动程序实现.

因此,"rmongodb"本身当前无法连接到MongoDB 3.x服务器.如果可以通过完全身份验证支持将它的开发加速到下一个版本,则可以应用其他选择之一,和/或自己对存储库做出贡献.

So "rmongodb" itself cannot currently connect to MongoDB 3.x servers. Either apply one of the other choices, and/or contribute to the respository yourself if you are able to speed it's development into the next version with full authentication suppport.

在此答案中所链接的问题中,链接或讨论了其他可能的驱动程序替代方案.

Other possible driver alternatives are linked or dicussed in the issue linked in this answer.

这篇关于rmongodb身份验证始终失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆