1. Download the installation package
https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-3.0.0-signed.msi?_ga=1.22066811.1599532380.1422017396
When the download is complete, place the installation file under the directory you want to install.
2, perform the installation
Open the Run box with win+r and enter "CMD" to run. (To run as an administrator) switch the directory to the installed directory and execute the following command.
msiexec.exe/q/I mongodb-win32-x86_64-2008plus-ssl-3.0.0-signed.msi installlocation= "installation directory" ADDLOCAL= Monitoringtools,importexporttools,miscellaneoustools
Or
msiexec.exe/q/I mongodb-win32-x86_64-2008plus-ssl-3.0.0-signed.msi installlocation= "installation directory" ADDLOCAL=ALL
The parameters that are added after ps:addlocal are the services that you want to install.
3, create a database
Create a directory using the command MD \data\db
Create the initial database Mongod.exe--dbpath installation directory \data
4. Register MongoDB as a Windows service
Use the command to create a log directory under the installation directory MD \data\log
Create a configuration file to write the database directory, log directory configuration to the file
echo logpath= installation directory \data\log\mongod.log> "C:\mongodb\mongod.cfg"
echo dbpath= installation directory \data\db>> "C:\mongodb\mongod.cfg"
Create a MongoDB service
Sc.exe create MongoDB binpath= "\" Install directory \bin\mongod.exe\ "--service--config=\" installation directory \mongod.cfg\ "Displayname=" MongoDB " start= "Auto"
Successful creation displays the following information
[SC] CreateService SUCCESS
Start the MongoDB service.
net start MongoDB
5, start, stop, delete MongoDB service (to be executed under management)
Start the service
net start MongoDB
Stop Service
net stop MongoDB
Removal service
Sc.exe Delete MongoDB
6, test whether the installation is successful
Under the Bin directory under the installation directory
Do the following
See the above message stating that the installation was successful!
MONGO DB Windows installation