我正在构建一个R脚本,在该脚本中,我需要通过身份验证连接到 MongoDB ,并使用瑞香草 package.For处理从数据库获取的数据,这些数据是我在版本3.0.4中创建了一个新的mongoDB用户,而连接到mongoDB的R脚本身份验证失败。此外,通过mongo成功地对用户进行身份验证。此外,当我对在MongoDB版本2.x中创建的用户进行身份验证时,身份验证工作正常。
下面是我们在R脚本中用来连接到Mongo数据库的代码片段。
mongo.create("127.0.0.1“、”用户“、"pass”、"db“、0L )
在执行上面的代码片段时,我们收到以下响应
错误:加载所需的包: rmongodb身份验证失败。
请建议我的适当解决方案,认证失败的问题,在rmongodb包。
发布于 2015-06-26 08:23:39
rmongodb (从1.8.0开始)使用了一个遗留的MongoDB C驱动程序,该驱动程序还没有完全支持MongoDB 3.0。特别是,它不支持使用新的SCRA-SHA-1默认身份验证或可选的WiredTiger存储引擎。
在rmongodb跟踪中有一个问题:与MongoDB 3.0版的兼容性。
在更新rmongodb之前,您的选项(对大多数麻烦来说是最少的)包括:
发布于 2015-07-28 05:05:11
我自己刚经历过这件事,我想我应该加上我的两分钱,以防它对别人有帮助。
@Stennie正对目标进行身份验证。因此,如果您想使用mongo 3,它的运行方式如下(这是从一个ubuntu安装)。
1) sudo nano /etc/mongod.conf 2) Comment out the "auth=TRUE" line 3) sudo service mongod restart 4) login to mongo shell (now with no authentication so everything is open) 5) use admin 6) Execute the following: var schema = db.system.version.findOne({"_id" : "authSchema"}) schema.currentVersion = 3 db.system.version.save(schema) (the above 3 commands are from here: https://jira.mongodb.org/browse/SERVER-17459) 7) create your users in the appropriate database 8) to make sure the right credentials are set up, type db.system.users.find() and amke sure they have the MONGODB-CR credentials 9) quit mongo 10) ucomment out the authentication line in /etc/mongod.conf 11) restart mongodb using sudo service mongod restart
现在就该工作了!我希望这能帮到别人..。
https://stackoverflow.com/questions/31065196
复制相似问题