1. Download and install
Download Path Login Official website: http://www.mongodb.org/downloads
2. Create a new directory
My path is D:\MongoDB.
The new directory structure under the MongoDB file is:
--MongoDB
--Bin
--Data
--DB
--Log
--MongoDB.log
3. Start
Each time you start MongoDB, it will run:
$ CD D:\MongoDB\bin
$ mongod-dbpath "D:\MongoDB\data\db"
4. Server Startup
$ d:\mongodb\bin>mongod--dbpath "D:\MongoDB\data\db"--logpath "D:\MongoDB\data\log\MongoDB.log"--install-- ServiceName "MongoDB"
MongoDB.log is the log file that was started, serviceName the "MongoDB" service named MongoDB.
Start the MongoDB service (only need to run at a later time):
$ d:\mongodb\bin>net Start MongoDB
Then open Task Manager and you can see that the MONGODB process has started.
To close a service and delete a process:
$ d:\mongodb\bin>net Stop MongoDB (shutdown service)
$ d:\mongodb\bin>mongod--dbpath "D:\MongoDB\data\db"--logpath "D:\MongoDB\data\log\MongoDB.log"--remove-- ServiceName "MongoDB"
MongoDB Installation and Windows service startup