Mongo db windows installation, mongodb

Source: Internet
Author: User
Tags create mongodb

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!

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.