1、安装过程中报错(类似下图):
原因:没有管理员权限
解决:管理员运行cmd,找到该文件所在位置,执行
1 msiexec /package node-v8.7.0-64.msi
2、进入添加环境变量,在path里面添加mongo所在文件夹的bin路径,如 D:\MongoDB\bin
3、在D:\MongoDB\bin目录下新建mongo.config文件, 添加以下内容(根据每个人设置而定)
1 ##数据库目录## 2 dbpath=D:\MongoDB\data\db 3 ##日志输出文件## 4 logpath=D:\MongoDB\data\log\db.log添加后cmd运行
1 mongod --config "E:\mongodb\mongo.config"4、添加到计算机服务,cmd窗口输入
1 mongod --config "E:\mongodb\mongo.config" --install --serviceName "MongoDB"5、启动服务报错
在bin目录下有个mongod.cfg,打开,修成成下面:
1 # mongod.conf 2 3 # for documentation of all options, see: 4 # http://docs.mongodb.org/manual/reference/configuration-options/ 5 6 # Where and how to store data. 7 storage: 8 dbPath: D:\MongoDB\data\db 9 journal: 10 enabled: true 11 # engine: 12 # mmapv1: 13 # wiredTiger: 14 15 # where to write logging data. 16 systemLog: 17 destination: file 18 logAppend: true 19 path: D:\MongoDB\data\log\db.log 20 21 # network interfaces 22 net: 23 port: 27017 24 bindIp: 127.0.0.1 25 26 27 #processManagement: 28 29 #security: 30 31 #operationProfiling: 32 33 #replication: 34 35 #sharding: 36 37 ## Enterprise-Only Options: 38 39 #auditLog: 40 41 #snmp: 42 43 44
转载于:https://www.cnblogs.com/han200113/p/11519175.html