第一步下载mongodb
目前最新版本:3.4.4
第二步安装vc_redist.x64
服务器安装可能会需要到,如果没有出现以下错误不需要安装
---------------------------
mongod.exe - System Error
---------------------------
The program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing from your computer. Try reinstalling the program to fix this problem.
---------------------------
OK
---------------------------
注意事项:
安装完成后可以运行安装服务
mongod.exe --bind_ip yourIPadress --logpath "C:\data\dbConf\mongodb.log" --logappend --dbpath "C:\data\db" --port yourPortNumber --serviceName "YourServiceName" --serviceDisplayName "YourServiceName" --install
如果不能正常安装服务,确保CMD一定要以管理员运行
安装完出现服务不能启用可能会出现以下错误
---------------------------
Services
---------------------------
Windows could not start the MongoDBServices on Local Computer. For more information, review the System Event Log. If this is a non-Microsoft service, contact the service vendor, and refer to service-specific error code 100.
---------------------------
OK
---------------------------
可以去检查指定的mongodb.log文件,日志记录非常详细帮助排查问题所在。一定注意配置的文件地址