其中Windows版本(2016-08-15)支持以下版本: - Windows Server 2008 R2 64-bit and later, with SSL support - Windows Server 2008 R2 64-bit and later, without SSL support - Windows Vista 32-bit and later, without SSL support - Windows Server 2008 64-bit and later, without SSL support
本人使用Windows 7 64-bit版本,选择第一个下载
安装到用户自定义路径下即可
根据用户需求,在相应路径下创建文件夹
*本人数据目录的路径为: D:\MongoDB\database*在Path中添加MongoDB的安装路径下的bin文件所在路径
本人MongoDB的bin文件路径为: D:\Program Files\MongoDB\Server\3.2\bin以管理员方式运行
mongod.exe --bind_ip 127.0.0.1 -logpath "D:\MongoDB\database" --logappend --dbpath "D:\MongoDB\log\mongodb.log" --port 27017 --serviceName "EnvMongoDB" --serviceDisplayName "EnvironmentDB" --install其中具体参数如下
参数描述–bind_ip绑定服务IP,若绑定127.0.0.1,则只能本机访问,不指定默认本地所有IP–logpath指定MongoDB日志文件,注意是指定文件不是目录–logappend使用追加的方式写日志–dbpath指定数据库路径–port指定服务端口号,默认端口27017–serviceName指定服务名称–serviceDisplayName指定服务名称,有多个mongodb服务时执行–install指定作为一个Windows服务安装