Every time, we use mongoDB, must to manual input:
C:\users\XXX>cd /d d:\MongoDB\bin
d:\MongoDB\bin>mongod -dbpath D:\MongoDB\data
So, we can install it as Windows service.
Success:
Right click the command prompt, and open it with "Run as Administrator".
C:\Windows\system32>cd /d d:\MongoDB\bin
d:\MongoDB\bin>mongod -dbpath D:\MongoDB\data --logpath D:\MongoDB\logs\mongodb.log --logappend --directoryperdb --serviceName MongoDB --install
all output going to: D:\MongoDB\logs\mongodb.log
show mongodb.log
引用
Wed Dec 05 18:18:38 Trying to install Windows service 'MongoDB'
Wed Dec 05 18:18:38 Service 'MongoDB' (Mongo DB) installed with command line '"d:\MongoDB\bin\mongod.exe" -dbpath "D:\MongoDB\data" --logpath "D:\MongoDB\logs\mongodb.log" --logappend --directoryperdb --service '
Wed Dec 05 18:18:38 Service can be started from the command line with 'net start MongoDB'
start MongoDB:
d:\MongoDB\bin>net start MongoDB
The Mongo DB service is starting.
The Mongo DB service was started successfully.
stop MongoDB:
d:\MongoDB\bin>net stop MongoDB
System error 109 has occurred.
The pipe has been ended.
---> I dont know this question, but in the log file, the service was stopped.
delete MongoDB:
C:\Windows\System32>sc delete MongoDB
[SC] DeleteService SUCCESS
or run regedit, find HKEY_LOCAL_MACHINE->SYSTEM->CurrentControlSet->Services->MongoDB, then delete it.
Attention:
1. --dbpath: data directory
--directoryperdb: Each DB will create a new directory.
2. --logpath: log file directory
here,log file must be XXX.log, if it isn't existed, it will be created automatically.
--logappend: XXX.log output in additional way.
3. --serviceName: Windows service name, here pay attention to the letter "N".
4. all the above commands must run as administrator.
Question in the process:
1.
d:\MongoDB\bin>mongod -dbpath D:\MongoDB\data --install
Wed Dec 05 18:07:37 --install has to be used with --logpath
------> This because we need to install --logpath
2. If we don't open the command prompt as administrator, it maybe occurrce the following error:
Error connecting to the service Control Manager: Access is denied. (5)
or, we start MongoDB, also occurrce the error:
System error 5 has occurred.
Access is denied.
------> So must "Run as administrator".
- 大小: 23.1 KB
- 大小: 18.5 KB
- 大小: 18.6 KB
- 大小: 25.9 KB
分享到:
相关推荐
mongodb 可视化工具。记住是64位的,在32位操作系统可能有不兼容情况
本来不想要资源分硬是要有,没办法。。。WIN7装mongodb可视化工具robomongo
mongodb Windows7 64位
MongoDB-4.0-WIN64版,希望对你有所帮助! MongoDB-4.0-WIN64版,希望对你有所帮助! MongoDB-4.0-WIN64版,希望对你有所帮助!
MongoDB-2018-win64-enterprise-MongoDB 企业版安装包
mongodb-bi-win32-x86_64-v2.3.0-rc0.msi,官网下载很慢,好东西分享下
本来不想要资源分硬是要有,没办法。。。WIN7装mongodb所需的插件
1、mongodb java 简单操作 win32 安装步骤 2、mongodb hello word
mongodb64位win3.69版本安装包,win8.1 64位亲测能用。
MongoDB 是一个基于分布式文件存储的数据库。由C++语言编写。旨在为WEB应用提供可扩展的高性能数据存储解决方案。 MongoDB 是一个介于关系数据库和非关系数据库之间的产品,是非关系数据库当中功能最丰富,最像关系...
Centos7下安装MongoDB
mongodb仅支持在win7操作系统64位上安装,分享给需要的同学
win 上的MongoDB启动bat脚本。必须提前配置好MongoDB的服务。使用时,需要使用管理员权限运行(对服务操作的权限)
MongoDB win 32位,MongoDB win 32位,MongoDB win 32位
4.4.5 MongoDB + 1.4.3 Robot 3T连接工具,官网下载,配置已初始化好,包含一键添加服务、一键启动、关闭等脚本。使用方便,亲测好用。配套文章:https://blog.csdn.net/qq_33204709/article/details/115905659
windows的mongodb-win32-x86_64-2.0.6 windows的mongodb-win32-x86_64-2.0.6
MongoDB安装包mongodb-win32-x86_64-2008plus-ssl-3.2.21-signed.msi
mongodb数据库-3.4.6版本-适用于win32_64位系统 msi版本