Thank you: 77776706
First, Download:
Website address: https://www.mongodb.com/download-center?jmp=nav#community
Second, installation:
After selecting a custom installation path, the next step is to uncheck the MongoDB Compass by default and cancel it. Check will make the whole installation process very slow, can be downloaded separately on the official website.
Third, the use
1. Create the following three paths: Database path (data directory), log path (logs directory), and log file (Mongo.log file)
2, the configuration file mongo.conf, the contents are as follows:
#数据库路径 dbpath=d:\program files\mongodb\server\3.6\data #日志输出文件路径 logpath=d:\program files\mongodb\ Server\3.6\logs\mongo.log #错误日志采用追加模式 logappend=true #启用日志文件, Journal=true is enabled by default # This option can filter out some useless log information, if you need to debug use set to False Quiet=true #端口号 default is 27017
3. Start MongoDB Service
Open the cmd window and go to the bin path under the MongoDB installation directory and execute Mongod--config "D:\Program files\mongodb\server\3.6\mongo.conf"
In the browser open http://127.0.0.1:27017/, and then you can see in the data and log directory, there are files generated.
4. Create and start MongoDB service
If it is troublesome to do this every time, follow the command below to create and start the MongoDB service, you can manage the startup and shutdown of MongoDB through the Windows service.
Mongod--config "D:\Program files\mongodb\server\3.6\mongo.conf"--install--servicename "MongoDB"
Start Service: Net start MongoDB
You can add it to an environment variable to execute the MONGO command
Test:
MongoDB Download, install, configure and use