如何将 Robomongo 连接到 MongoDB
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28336163/
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
How to connect Robomongo to MongoDB
提问by Karishma Dudhbade
I am having MongoDB and Robomongo in my running system, I am using Robomongo as client, I have installed MongoDB on different system which I am treating as server, I want to connect Robomongo of my system (as client) to MongoDB on other system (server).What steps should I follow to achieve the same? Any leads will be helpful. Thanks in advance
我正在运行的系统中有 MongoDB 和 Robomongo,我使用 Robomongo 作为客户端,我在不同的系统上安装了 MongoDB,我将其视为服务器,我想将我的系统(作为客户端)的 Robomongo 连接到其他系统上的 MongoDB(服务器)。我应该遵循哪些步骤来实现相同的目标?任何线索都会有所帮助。提前致谢
回答by Vaibhav
I was able to connect Robomongo to a remote instance of Mongo DB running on Mongo Labs using the connection string as follows:
我能够使用如下连接字符串将 Robomongo 连接到在 Mongo Labs 上运行的 Mongo DB 的远程实例:
Downloadlatest Robomongo. I downloaded 0.9 RC6 from here.
From the connection string, populate the server address and port numbersas follows.
下载最新的 Robomongo。我从这里下载了 0.9 RC6 。
从连接字符串中,如下填充服务器地址和端口号。
- Populate DB name and username and passwordas follows under the authentication tab.
- 在身份验证选项卡下按如下所示填充数据库名称和用户名和密码。
- Testthe connection.
- 测试连接。
Hope this help!
希望这有帮助!
回答by ShahNewazKhan
EDIT: Commenting out bind_ip can make your system vulnerable to security flaws, please see https://docs.mongodb.com/manual/administration/security-checklist/#limit-network-exposureIt is a better idea to add more IP's than to open up your system to everything.
编辑:注释掉 bind_ip 会使您的系统容易受到安全漏洞的影响,请参阅https://docs.mongodb.com/manual/administration/security-checklist/#limit-network-exposure添加更多 IP 比向一切开放你的系统。
You need to edit your /etc/mongod.conf file's bind_ip variable to include the IP of the computer you're using, or eliminate it altogether.
您需要编辑 /etc/mongod.conf 文件的 bind_ip 变量以包含您正在使用的计算机的 IP,或者完全消除它。
I was able to connect using the following mongod.conf , I commented out bind_ip and uncommented port.
我能够使用以下 mongod.conf 进行连接,我注释掉了 bind_ip 和未注释的端口。
# mongod.conf
# Where to store the data.
# Note: if you run mongodb as a non-root user (recommended) you may
# need to create and set permissions for this directory manually,
# e.g., if the parent directory isn't mutable by the mongodb user.
dbpath=/var/lib/mongodb
#where to log
logpath=/var/log/mongodb/mongod.log
logappend=true
port = 27017
# Listen to local interface only. Comment out to listen on all
interfaces.
#bind_ip = 127.0.0.1
# Disables write-ahead journaling
# nojournal = true
# Enables periodic logging of CPU utilization and I/O wait
#cpu = true
# Turn on/off security. Off is currently the default
#noauth = true
#auth = true
# Verbose logging output.
#verbose = true
# Inspect all client data for validity on receipt (useful for
# developing drivers)
#objcheck = true
# Enable db quota management
#quota = true
# Set oplogging level where n is
# 0=off (default)
# 1=W
# 2=R
# 3=both
# 7=W+some reads
#diaglog = 0
# Ignore query hints
#nohints = true
# Enable the HTTP interface (Defaults to port 28017).
#httpinterface = true
# Turns off server-side scripting. This will result in greatly limited
# functionality
#noscripting = true
# Turns off table scans. Any query that would do a table scan fails.
#notablescan = true
# Disable data file preallocation.
#noprealloc = true
# Specify .ns file size for new databases.
# nssize = <size>
# Replication Options
# in replicated mongo databases, specify the replica set name here
#replSet=setname
# maximum size in megabytes for replication operation log
#oplogSize=1024
# path to a key file storing authentication info for connections
# between replica set members
#keyFile=/path/to/keyfile
Don't forget to restart mongod service before trying to connect:
在尝试连接之前不要忘记重新启动 mongod 服务:
service mongod restart
From robomongo I used the following connection settings:
在 robomongo 中,我使用了以下连接设置:
Connection Tab:
连接选项卡:
Address: [VPS IP] : 27017
地址:【VPS IP】:27017
SSH Tab:
SSH 选项卡:
SSH Address: [VPS IP] : 22
SSH 地址:[VPS IP]:22
SSH User Name: [Username for sudo enabled user]
SSH 用户名:[启用 sudo 的用户的用户名]
SSH Auth Method: Password
SSH 身份验证方法:密码
User Password: Supersecret
用户密码:Supersecret
回答by Manvender Singh Rathore
First you have to run
mongod
command in your terminal make sure the command execute properly.Then in new terminal tab run
mongo
command.Then open Robomongo GUI and create a new connection with default setting.
首先,您必须
mongod
在终端中运行命令以确保命令正确执行。然后在新的终端选项卡中运行
mongo
命令。然后打开 Robomongo GUI 并使用默认设置创建一个新连接。
Hopefully this will solve your problem
希望这能解决你的问题
Cheers !!
干杯!!
回答by alexander_ch
Looks like Robomongo not yet works with Mongo 3
看起来 Robomongo 还不能与 Mongo 3 一起使用
回答by DonFabiolas
Currently, Robomongo 0.8.x doesn't work with MongoDB 3.0 :: - Mongodb & Robomongo: Can't connect (authentication)- https://github.com/paralect/robomongo/issues/766
目前,Robomongo 0.8.x 不适用于 MongoDB 3.0 :: - Mongodb & Robomongo:无法连接(身份验证)- https://github.com/paralect/robomongo/issues/766
For now, don't use Robomongo, for me, the best solution for me is to use mongochef : http://3t.io/mongochef/
现在,不使用Robomongo,对我来说,对我来说最好的解决方案是使用mongochef:http://3t.io/mongochef/
回答by sepehr
Have encountered any specific error so far?! btw, here's what we do:
到目前为止是否遇到任何特定错误?!顺便说一句,这是我们要做的:
- Create a new connection, set the name, IP address and the appropriate port
- 创建新连接,设置名称、IP 地址和适当的端口
- Setup authentication, if required
- 如果需要,设置身份验证
Optionally setup other available settings for SSL, SSH, etc.
Save and connect
(可选)为 SSL、SSH 等设置其他可用设置。
保存并连接
回答by Jag
回答by DanielV
I exported from Studio 3T the following connection:
我从 Studio 3T 导出了以下连接:
mongodb://youn-nosql-grej-test:[email protected]:10255/admin?3t.uriVersion=2&3t.certificatePreference=RootCACert:accept_any&3t.databases=admin&3t.connectionMode=direct&3t.useClientCertPassword=false&3t.connection.name=Grej-Test&readPreference=primary&ssl=true
mongodb://youn-nosql-grej-test:[email protected]:10255/admin?3t.uriVersion=2&3t.certificatePreference=RootCACert:accept_any&3t.databases=admin&3t.connectionMode= direct&3t.useClientCertPassword=false&3t.connection.name=Grej-Test&readPreference=primary&ssl=true
回答by Tim Long
Robomongo 0.8.5 definitely works with MongoDB 3.X (mine version of mongoDB is 3.0.7, the newest one).
Robomongo 0.8.5 绝对适用于 MongoDB 3.X(我的 mongoDB 版本是 3.0.7,最新版本)。
The following steps should be done to connect to mongodb server:
要连接到 mongodb 服务器,应执行以下步骤:
- Install Mongodb server (on Windows, Linux... your choice)
- Run Mongodb server. Don't set net.bind_ip = 127.0.0.1 if you want the client to connect to the server by server's own ip-address!
- Connect to the server from Robomongo with the server ip + set authentication if needed.
- 安装 Mongodb 服务器(在 Windows、Linux 上……您的选择)
- 运行 Mongodb 服务器。如果你想让客户端通过服务器自己的 ip-address 连接到服务器,不要设置 net.bind_ip = 127.0.0.1!
- 如果需要,使用服务器 ip + 设置身份验证从 Robomongo 连接到服务器。
回答by technocrusaders.com
- Comment out /etc/mongod.conf file's bind_ip
- Download https://download.robomongo.org/0.9.0-rc9/windows/robomongo-0.9.0-rc9-windows-x86_64-0bb5668.exe
Connection TAB:
3.1 Name ( whatever )
3.2 Address ( IP of server ) : Port number ( 27017 )
SSH TAB ( I used my normal putty connection details )
4.1 SSH Address : [ IP of server ]
4.2 SSH User Name [ User Name ]
4.3 User Password [ password ]
- 注释掉 /etc/mongod.conf 文件的 bind_ip
- 下载https://download.robomongo.org/0.9.0-rc9/windows/robomongo-0.9.0-rc9-windows-x86_64-0bb5668.exe
连接选项卡:
3.1 名称(随便)
3.2 地址(服务器IP):端口号(27017)
SSH TAB(我使用了普通的腻子连接详细信息)
4.1 SSH 地址:[服务器IP]
4.2 SSH用户名【用户名】
4.3 用户密码【密码】