【发布时间】:2015-05-07 07:26:55
【问题描述】:
我已经下载了 MongoDB Windows msi 安装并成功运行。
mongod.exe 和 mongo.exe 命令文件执行正常。
安装手册显示如何创建配置文件,然后使用命令创建 Windows Server
sc.exe create MongoDB binPath= "\"C:\mongodb\mongod.exe\" --service --config=\"C:\mongodb\mongod.cfg\""
这会创建一个 SUCCESS 响应。
服务随即启动
net start MongoDB
但这会产生响应
System Error 2 has occurred.
The system cannot find the file specified.
解决方法,有需要的人,是手册指出mongod.exe的默认路径不正确,应该在bin目录下
C:\mongodb\bin\mongod.exe
因此,虽然这是一个问题,但为了其他可能遇到此问题的人的利益,我也解决了这个问题。
另外,默认情况下,MongoDB 会安装在 Windows 的 C:\Program Files 中,您应该使用自定义安装将其放入 C:\mongodb。
【问题讨论】:
-
我不同意这是重复的。我的问题是默认实现和手册不同步。这不在引用的问题或其答案中。