MongoDB安装后允许其他IP访问的方法

转载:https://blog.csdn.net/weixin_42529849/article/details/80786426

MongoDB 服务器启动后,不进行配置,其他机器无法访问,需要进行如下配置:

1、找到你的mongod.cfg配置文件,增加bindIp的配置,记住要想让其他机器访问,需要绑定为0.0.0.0

此配置文件的内容格式为yml,编写时注意空格,否则,无法启动服务器。

systemLog:
    destination: file
    path: d:\data\log\mongod.log
storage:
    dbPath: d:\data\db
net:
    bindIp: 0.0.0.0
    port: 27017

2、关闭防火墙或让服务器的防火墙开放mongodb的端口27017;

猜你喜欢

转载自blog.csdn.net/xqhys/article/details/89216754
今日推荐