MONGO DB Windows installation

Source: Internet
Author: User
Tags create 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.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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.