MongoDB安装

1、安装的时候目录不能有空格,之前有空格时后面总会报错(windows 7)
mongo D:MongoDBServer3.2in
 

2、新建mongo.config文件
##数据文件
dbpath=D:MongoDBdata
 
##日志文件
logpath=D:MongoDBlogsmongo.log
 
3、 启动 
cmd cd D:MongoDBServer3.2in
mongod --config D:MongoDBmongo.config
 
4、运行
cmd cd D:MongoDBServer3.2in 
mongo
 
 
5、服务式启动
cd D:MongoDBServer3.2in 
mongod.exe --install --logpath=D:MongoDBlogsmongo.txt --dbpath=D:MongoDBdatadb
net start MongoDB
 
可以把D:MongoDBServer3.2in 配置到环境变量 path,启动时就不用再进入目录
原文地址:https://www.cnblogs.com/eaysun/p/5530372.html