MongoDB How to add to the Windows service _mongodb

Source: Internet
Author: User
Tags mongodb

MongoDB is an open source NoSQL database that is primarily used in large data situations and is considered the Node.js's golden partner, and because it uses the binary JSON format, it has no affinity to JavaScript with any language. The specific introduction of this article does not elaborate, the following is mainly for MongoDB in Windows to join local services to do some simple sharing. To facilitate the first contact with MongoDB and in the Windows environment for the development of students.

First go to the official website to download the Windows Installer package: Http://www.mongodb.org/downloads

In general, choose the default 64-bit (unless your host is 32-bit), download, assuming we install to: d:/soft/mongodb/, complete, enter the directory, new data and logs two folders, and in the logs directory to create a new mongodb.log. Then open a command prompt (CMD) and the Windows8.1 user needs to be opened with an administrator. Execute the following command:

Copy Code code as follows:

D: && Cd/soft/mongodb/bin
Enter, and then execute:
Mongod--dbpath D:/soft/mongodb/data

So MongoDB happily starts, opens the browser, enters: http://127.0.0.1:27017, at this time you can see the following prompt language:

Copy Code code as follows:

It looks like your are trying to access MongoDB over HTTP on the native driver port.
Translation: You seem to be trying to access MongoDB via HTTP Local Service

Well, it's just a soy sauce. In fact, every time we start MONGO from the command line it is painful, so we need to create a permanent service, which requires us to add MONGO to the Windows Local Service. Go back to cmd, execute:

Copy Code code as follows:

Since we have already entered the D:/soft/mongodb/bin directory, just execute the following command:
Mongod.exe--logpath d:/soft/mongodb/logs/mongodb.log--logappend--dbpath d:/soft/mongodb/data-- ServiceName Mongodb-install

By opening the service window, you can see the results we need:

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.