Cannot connect to mongodb using machine ip

前端 未结 5 1371
没有蜡笔的小新
没有蜡笔的小新 2020-12-01 14:48

Installed Mongo using homebrew. If I type mongo on shell, it gets connected to test. But when I type the ip address

5条回答
  •  余生分开走
    2020-12-01 15:18

    success:

    1. change service config file C:\Program Files\MongoDB\Server\4.0\bin\mongod.cfg
    # network interfaces (wjp: comment bindIp listening on all IPs)
    net:
      port: 27017
    #  bindIp: 127.0.0.1
      bindIp: 0.0.0.0
    
    1. restart mongodb service (or restart computer);
    2. make sure machine level firewall open port 27017
    3. connect ok.

提交回复
热议问题