Windows Platform Installation MongoDB

Source: Internet
Author: User
Tags mkdir mongodb download mongodb server

MongoDB Download

: https://www.mongodb.com/download-center#community

Install into the C packing directory

Create Data Catalog

MongoDB stores the data directory in the DB directory. However, this data directory is not actively created, and we need to create it after the installation is complete. Note that the data directory should be placed under the root directory (e.g. C: \ or D:\. , etc.).

In this tutorial, we have MongoDB installed on C Drive, now let's create a directory of data and create a DB directory in the data directory.

C:\>cd C:C:\>mkdir datac:\>cd datac:\data>mkdir DBC :\data>cd DBC:\data\db>         

Run MongoDB server under command line

In order to run the MongoDB server from the command prompt, you must execute the Mongod.exe file from the bin directory of the MongoDB directory.

C:\mongodb\bin--dbpath C:\data\db      

Connect to MongoDB

We can run the Mongo.exe command in the command window to connect to MongoDB and execute the following command:

C:\mongodb\bin\mongo.  Exe
Configuring MongoDB Services

Creating a configuration file

Create a configuration file. The file must have the Systemlog.path parameter set, including some additional configuration options that are better.

For example, create a configuration file that is located in C:\mongodb\mongod.cfg, where Systemlog.path and Storage.dbpath are specified. The specific configuration is as follows:

Storage
Dbpath:c:\data\db
Net
bindip:127.0.0.1
port:12345
Systemlog:
Destination:file
Path:c:\data\log\mongod.log

Installing MongoDB Services

By executing Mongod.exe, using the--install option to install the service, use the--config option to specify the previously created configuration file.

"C:\mongodb\bin\mongod.exe"--"C:\mongodb\mongod.cfg"--Install

Start MongoDB Service

Mongodb

Close MongoDB Service

Mongodb

Windows Platform Installation MongoDB

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.