Windows System Installation MongoDB

Source: Internet
Author: User
Tags install mongodb mongodb server

Recently has been learning the Node.js,nodejs Development Guide has a microblog web development project, because the book is relatively early (2012 out), so far the use of Nodejs web development of various combinations of technologies have undergone great updates, For example, the book chooses the MVC framework for express, but it is an early version, The latest version is 4.12.1, the previous version of 3.X is directly integrated into the various middleware express, in the 4.X version, in addition to the static file routing mapping middleware, the rest are loaded into the framework by require mode. Also, for example, the author of the Nodejs Development Guide chooses Ejs as the template engine, but the Express project, which is automatically generated using the command line, uses Jade as the default template engine, so it is obviously not possible to follow this book retrace. So I'm going to nodejs this microblog project in the latest combination of the present v0.1033+express4.12.1+jade1.9.2+ MongoDB3.0 to Refactor, will later write a series of articles to summarize the learning steps and experience, today first to record the installation of MongoDB under Windows system process, the original book does not explain how to install MongoDB.

1. Download the latest version of MongoDB

Http://www.mongodb.org/downloads, note here to follow your own system download, my system is 64-bit win8.1, so the download is 64-bit MSI file;

2. After the download is complete, double-click the installation, the installation process is the next point to the end, and finally end the installation;

3. MongoDB server is now installed in your system, the default will be in the Program Files folder C, under the folder to find the MongoDB folder, go into the bin directory, as follows:

4. Create a data file storage path, create a folder on the disk to store the MongoDB data file as follows (I created it in the D drive):

mkdir data\db

At this time, I created a data folder in my D disk with a DB folder to hold the MongoDB file.

5. Specify the data storage path

Under the command line, go to the bin directory just below,

C:CD Program Files\mongodb\server\ 3.0\ Bin

The specific path depends on the path you install, using the Mongod.exe in this directory to register the data storage directory

Mongod.exe--dbpath D:\data

The dbpath here is the data storage directory you created, when a lot of text appears on the command line to register successfully, as follows:

Theoretically, this time is already a MongoDB installation configuration is complete, you can use the command line just below the bin path of the Mongod.exe to start it,

C:\Program files\mongodb\server\3.0\bin\mongod.exe

But every time you start using a long string of paths is in trouble, we need to register it as a Windows service and have him boot up automatically.

6. Create a log directory to hold the log file in the data directory just below

D:CD Data mkdir Log

Then create a mongod.cfg file in the data directory as the configuration file;

7. Writing configuration information to a configuration file

Echo " D:\data\mongod.cfg " Echo " D:\data\mongod.cfg "

The meaning of these two sentences is to write DBPath and logpath to the configuration file

8. Registering Windows services with Sc.exe

" \ "C:\Program files\mongodb\server\3.0\bin\mongod.exe\"--service--config=\ "D:\data\mongod.cfg\" " " MongoDB " " Auto "

If the command line output CreateService is successful, the registration service is successful;

9. Using Windows services to turn on MongoDB and turn off MongoDB

net start mongodbnet stop MongoDB

As shown below:

At this point, MongoDB has been installed to complete. Finally recommend English good students directly to the official website to see the document, which is detailed introduction of the installation, operation and use of the process.

Windows System 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.