A: download installation, and then copy to C disk root directory, this is not much to say, than QQ are simple.

Copy the bin folder to the MongoDB directory, create a data folder under the root directory to store logs and databases, create db and log folders under the data folder, and create a log file under the log folder as follows: mongolog.log

As shown in figure:

3. A configuration file is displayed in the mongodb root directory. The content is as follows:

dbpath=c:\MongoDb\data\db
logpath=c:\MongoDB\data\log\mongolog.log
logappend=true
auth=false
Copy the code

This is the contents of the mongodb.config file. Auth defaults to false and cannot be authenticated with a password

4: PowerShell administrator mode Locate the bin directory and run it

.\mongod --config c:\MongoDB\mongodb.config --serviceName MongoDB --install
Copy the code

Now that the service is installed, right click on the service to start it, and then mongodb is installed. Set the password

5. When Mongod. Exe is closed, Mongo. exe cannot connect to the database, so every time you want to use mongodb database, you have to start Mongod

Again, run CMD, go to the bin folder, and execute the following command

> d:\mongodb\bin>mongod --dbpath "d:\mongodb\data\db" --logpath "d:\mongodb\data\log\MongoDB.log" 
  --install --serviceName "MongoDB"
Copy the code

–serviceName the “MongoDB” service is named MongoDB and then start the MongoDB service

Close services and delete processes

>D :\mongodb\bin>NET stop mongodb
> d:\mongodb\bin>mongod --dbpath "d:\mongodb\data\db" --logpath "d:\mongodb\data\log\MongoDB.log" --remove --serviceName "MongoDB"     
Copy the code

(Delete –install)