Install and configure MongoDB in Windows

Source: Internet
Author: User
Tags mongodb setup

Installation files: Official Website http://www.mongodb.org/downloads

Select the file to download from the system.

1. decompress the file.

Decompress the compressed package, create a folder named mongodbon on the d Drive, and copy all the. exe files in the compressed package to the D: MongoDB folder.

2. Create a working directory.

1. Create a data storage directory D: \ mongodb \ data

2. Create a log file D: \ mongodb \ log \ mongodb. log

3. Set system variables. To facilitate mongodb management from the console, you do not need to enter D: MongoDB every time.

My computer -- Property -- Advanced -- environment variable -- path in the system variable, plus; D: \ MongoDB, note that the semicolon is added before. For example:

3. Start the mongdb service.

Enter mongod.exe -- dbpath = D: \ MongoDB \ data in the console. For example:

In this way, the service is started. Normally, the following is displayed:

Enter http: // localhost: 27017/in the browser /. Will appear

You are trying to access MongoDB on the native driver port. For http diagnostic access, add 1000 to the port number

The surface service has been started.

Do not close the current Console window. Start another console and enter mongo. Example:

Indicates that mongdb is successfully connected.

4. Use mongdb as a windows Service for random startup.

On the console, enter mongod.exe -- dbpath = D: \ mongodb \ data -- logpath = D: \ mongodb \ logs \ mongodb. log -- install

Normally

V. Connect to mongodb

Enter "net start mongodb" in the console and the message "Mongo DB service started successfully" appears.

Enter mongo and you will be connected to test. In my computer -- manage -- service and application, you can see that the MongoDB service has been successfully started.

Vi. Exception Handling

If an error occurs:


Check whether the service is started. if the service is not started, start the service first. if the service is started, it may be because mongo was disabled improperly last time, and the data storage file is occupied, locked. Delete the mongod. lock file in D: \ MongoDB \ data. Restart the service.

Edit recommendations]

  1. MongoDB 2.0 official version released
  2. View the Compact Command one by one in the new functions of MongoDB 2.0
  3. Comprehensive Evaluation of mainstream NoSQL databases-MongoDB
  4. How to use MySQL to learn MongoDB
  5. MongoDB setup and simple operations in Windows

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.