Window System MongoDB installation, startup and how to set up for Windows Services (summary)

Source: Internet
Author: User

One: Download

On the MongoDB official website, download the appropriate version of your computer system and install it to the appropriate location. I downloaded here for:

After the installation I put on the "D", change the folder name "MongoDB" (data,etc,logs three folders for the following self-created, explained later).

Second: Open service and close

To create the database directory D:\mongodb\data, next open the cmd Command Line window, switch to the D:\mongodb\bin directory to execute the following command (where--dbpath is the specified database storage directory, there are two "-"):

Mongod--dbpath D:\MongoDB\data

At this point, the command-line window prints some startup information, and the last line displays the following information to indicate that the launch was successful.

2014-04-23t10:38:48.391+0800 [Initandlisten] waiting for connections on port 27017

At this point in the browser input http://localhost:27017/can see the display information is:

Do not understand the cmd command can go to Baidu, as long as it will simply enter the folder (CD. ) and Exit folder (CD: ), follow the steps below to paste the cmd:

Now that the MongoDB service has started, close this cmd window and it will automatically shut down the service.

You can restart the service again next time with the same steps. (Not recommended)

In fact it is painful to start MONGO every time through the command line, so we need to create a permanent service, which requires us to add MONGO to the Windows Local Service. Continue back to CMD, execute (will create a log folder and log files, the Data folder path is the path of the native data):

Mongod.exe--logpath D:\mongodb\logs\mongodb.log--logappend--dbpath D:\mongodb\data--directoryperdb--servicename MongoDB--install

After the service is created, the default is stop state, we need to manually open the service, with the command, net start MongoDB, open the service. (If not, you can open the Task Manager yourself, find the relevant service, and open it manually.) Indicates that the MongoDB service is started)

If you see the display is running, so long work has caused the ~ after this service to start MongoDB ~

Window System MongoDB installation, startup and how to set up for Windows Services (summary)

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.