step
- Download the installation executable file
download version Community
- Modify environment variables
add the path to the installation directory path
- Create a log and db directory
mkdir c:\data\db mkdir c:\data\log
If you want to specify another directory, run to bring --dbpath parameters:
mongod --dbpath d:\test\mongodb\data
- Create a configuration file
to create the file C: \ Program Files \ MongoDB \ Server \ 3.2 \ mongod.cfg.
systemLog:
destination: file
path: c:\data\log\mongod.log
storage:
dbPath: c:\data\db
- Creating MongoDB service
mongod --config "C:\Program Files\MongoDB\Server\3.2\mongod.cfg" --install
- Startup, shutdown, remove service
net start MongoDB; net stop MongoDB; "C:\Program Files\MongoDB\Server\3.2\bin\mongod.exe" --remove