简体   繁体   中英

Connecting to a mongodb server running on a remote desktop windows

I have another PC at my home address (windows) which I use for a lot of my data processing. I use Remote Desktop Connection to connect to that PC (IP 123.456.789.00) where I have a mongodb server running. I want to connect to that mongo server on my laptop (windows). So far I have tried following several instructions but I am struggling to connect. So far I have tried setting up the user:


db.createUser({
    user: 'ian',
    pwd: 'secretPassword',
    roles: [{ role: 'readWrite', db:'cool_db'}]
})

Then edited the.cfg file:

# network interfaces
net:
  bindIp : 0.0.0.0
  port: 27017
  
#processManagement:

security:
  authorization: 'enabled'

I believe I have opened up port 27017 following these instructions .

I have restarted mongo server on my pc at home.

Then I have tried logging in via mongo compass on my laptop but I can't connect:

在此处输入图像描述

Okay, I fixed my problem. Although I had opened the port on my PC's firewall, I had not opened it on the router. I logged in to my home router > firewall rules > add inbound > opened port 27017 within the port forwarding tab.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM