Installation and start-up of MongoDB under Win7

Source: Internet
Author: User

1. Download

Download the corresponding version of the system in MongoDB's official website (zip format recommended)

Extract to hard drive, path such as D:\MongoDB

2. Create a Directory

Create the Data folder under the MongoDB root directory (flat with the original bin directory);

Data inside the DB and log folder, respectively, for the storage and log;

PS: folder and file name arbitrarily, just guarantee the path in the third step corresponding to

3. Start

Open cmd, enter the Bin folder , enter the command:

Mongod--dbpath E:\MongoDB\data\db--logpath E:\MongoDB\data\log\mongodb.log

Mongod // start command

--dbpath//Specify Data storage directory

--logpath //Specify log file directory (specified to file, can be txt format)

PS: If a folder or file name is created with a space, the path needs to be wrapped in double quotes, such as "E:\MongoDB\my data\db"

Display as, for startup success

  

Open Task Manager and you'll see the Mongod.exe process

You can then manipulate the database using a command or visualizer (such as a Robomongo) connection

  

4. Writing to the Windows service

It is inconvenient to use a long command every time you start, and you can write mongod to the Windows service to enable it later

The method is simple, add--install after the above command

Mongod--dbpath E:\MongoDB\data\db--logpath E:\MongoDB\data\log\mongodb.log--install

PS: The above command needs to ensure that cmd execution is opened under administrator privileges

  

Later, you can use the command to start/close the service:

net start mongodbnet stop MongoDB

  

@zhnoah
Source: http://www.cnblogs.com/zhnoah/
This article is owned by me and the blog Park, Welcome to reprint, but without the consent of the author must retain this paragraph, and in the article page obvious location to the original
The right to pursue legal liability.

Installation and start-up of MongoDB under Win7

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.