Mongo db windows installation, mongodb
1. Download the installation package
Https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-3.0.0-signed.msi? _ Ga = 1.22066811.15995322.16.142368396
After the download is complete, place the installation file under the directory you want to install.
2. Install
Open the run box with win + r and enter "cmd" to run. (Run as 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
Ps: The parameter added after ADDLOCAL is the service you want to install.
3. Create a database
Use the command md \ data \ db to create a directory
Create mongod.exe -- dbpath installation directory \ data
4. Register mongodb as a windows Service
Use the command to create the log directory md \ data \ log under the installation directory
Create a configuration file and write the configuration of the database directory and log directory 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 = "\" installation directory \ bin \ mongod.exe \ "-- service -- config = \" installation directory \ mongod. cfg \ "" DisplayName = "MongoDB" start = "auto"
The following information is displayed after the creation is successful.
[SC] CreateService SUCCESS
Start the MongoDB service.
Net start MongoDB
5. start, stop, and delete the mongodb Service (to be executed under management)
Start the service
Net start MongoDB
Stop Service
Net stop MongoDB
Remove Service
SC .exe delete MongoDB
6. test whether the installation is successful.
Under the bin directory under the installation directory
Run the following command:
The above information indicates that the installation is successful!