monodb安装

下载https://www.mongodb.com/download-center#community

选择community或enterprise server选项卡

下载msi安装版本

安装后mongodb是没有自动启动的,需要自己创建数据目录并安装系统服务

以管理员权限打开cmd

mkdir c:\monodb

mkdir c:\monodb\data

mkdir c:\monodb\log

c:\monodb目录下创建文件monodb.cfg

内容为

logpath=c:\mongodb\log\mongod.log 
dbpath=c:\mongodb\data

执行命令

"C:\Program Files\MongoDB\Server\3.6\bin\mongod" --config "c:\mongodb\mongod.cfg" --install

net start MongoDB

打开http://localhost:27017/确认是否运行成功

猜你喜欢

转载自haohetao.iteye.com/blog/2421574