Mongodb & Robomongo:无法连接(身份验证)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29325011/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Mongodb & Robomongo: Can't connect (authentication)
提问by Karl Morrison
I have the following user:
我有以下用户:
{
"_id" : "admin.root",
"user" : "root",
"db" : "admin",
"roles" : [
{
"role" : "root",
"db" : "admin"
}
]
}
And for my database:
对于我的数据库:
{
"_id" : "mydb.mydbDbOwner",
"user" : "mydbDbOwner",
"db" : "mydb",
"roles" : [
{
"role" : "dbOwner",
"db" : "mydb"
}
]
}
I can't connect via Robomongo on localhost.
我无法通过本地主机上的 Robomongo 进行连接。
Same goes for...
同样适用于...
Database: mydb
User Name: root
Database: mydb
User Name: mydbDbOwner
采纳答案by Athar
I was experiencing exactly the same issue on mac. I removed the robomongo client and download the latest version from their website. It just works :)
我在 mac 上遇到了完全相同的问题。我删除了 robomongo 客户端并从他们的网站下载最新版本。它只是有效:)
回答by Stennie
Robomongo 0.8.x doesn't have support for the new SCRAM-SHA-1 authentication which is the default in MongoDB 3.0. This is being worked on as part of the Robomongo 0.9.0 release (see: issue #766).
Robomongo 0.8.x 不支持新的 SCRAM-SHA-1 身份验证,这是 MongoDB 3.0 中的默认设置。这是 Robomongo 0.9.0 版本的一部分(参见:问题 #766)。
If you are using the default MMAP storage engine (and not WiredTiger, which also requires driver updates) there is a possible workaround described on the Robomongo issue -- downgrading to the older MONGODB-CR authentication format.
如果您使用的是默认的 MMAP 存储引擎(而不是 WiredTiger,它也需要驱动程序更新),在 Robomongo 问题上描述了一个可能的解决方法——降级到旧的 MONGODB-CR 身份验证格式。
There are also other data management UIs, some of which have already been updated with MongoDB 3.0 support.
还有其他数据管理 UI,其中一些已经更新为 MongoDB 3.0 支持。
For alternatives see:
有关替代方案,请参阅:
- MongoDB Tools- community site
- Admin UIs- MongoDB manual
- MongoDB 工具- 社区站点
- 管理 UI- MongoDB 手册
回答by Nicholas Rotondo
For anyone who comes along this question, i just upgraded to the new 1.0 for Robomongo. As a few people stated in here 0.8.x didnt support SCRAM-SHA-1, which is default in mongodb 3.0 prior versions it was MONGODB-CR. But anyone who is downloading Robomongo from this point on shouldnt have an issue with authentication.
对于遇到这个问题的任何人,我刚刚升级到 Robomongo 的新 1.0。正如这里的一些人所说,0.8.x 不支持 SCRAM-SHA-1,这是 mongodb 3.0 之前版本中的默认值,它是 MONGODB-CR。但是从现在开始下载 Robomongo 的任何人都不应该遇到身份验证问题。
This bottom links explains scram-sha a bit more, i suggest reading into it if heavily using mongodb https://docs.mongodb.com/manual/core/security-scram-sha-1/
这个底部链接更多地解释了 scram-sha,如果大量使用 mongodb https://docs.mongodb.com/manual/core/security-scram-sha-1/,我建议阅读它
回答by Duy Nguyen
You can try the Mongo-Express (a web-based tool). It is available here: https://github.com/andzdroid/mongo-express
您可以尝试使用 Mongo-Express(一种基于 Web 的工具)。可在此处获得:https: //github.com/andzdroid/mongo-express
However, you need to upgrade the mongodb-nodejs library to be at least (1.4.29) according to this: http://docs.mongodb.org/manual/release-notes/3.0-scram/
但是,您需要根据以下内容将 mongodb-nodejs 库升级到至少(1.4.29):http://docs.mongodb.org/manual/release-notes/3.0-scram/
I tried and it worked for my case. You can find below useful command for that:
我试过了,它对我的情况有效。您可以找到以下有用的命令:
npm install mongo-express cd node-modules/mongo-express
npm 安装 mongo-express cd 节点模块/mongo-express
Change config.default.js file to config.js and update it to include your databse connection (e.g. username, password, connection's url, etc...)
将 config.default.js 文件更改为 config.js 并更新它以包含您的数据库连接(例如用户名、密码、连接的 url 等...)
Edit package.jon file and change the version of mongodb to "~1.4.29"
编辑 package.jon 文件,将 mongodb 的版本改为“~1.4.29”
Run: npm update
运行: npm 更新
To start the web app: execute command "node app" and the web site will be available at http://localhost:8081/
启动 web 应用程序:执行命令“node app”,网站将在http://localhost:8081/可用
回答by Dzumi
You can change localhost to 127.0.0.1
您可以将本地主机更改为 127.0.0.1
回答by YaTaras
Possibility for connection through SSH tunnel with Robomong is back in the RC8 version. See github issue
通过 SSH 隧道与 Robomong 连接的可能性又回到了 RC8 版本。见github问题