Install mongoDB in windows and mongodb in windows

Source: Internet
Author: User
Tags install mongodb mongo shell

Install mongoDB in windows and mongodb in windows
1. Original Intention

This is so simple that I have been thinking about whether to write an article for a long time. However, for beginners, anything they have never touched may become a stumbling block, therefore, this blog aims to pave the way for record, rather than display level.

2. Download

Search for the keyword 'mongodb 'in Baidu or google, find and open the official website, click the open link, and click Download mongodb on the right. As of this article, no 64-bit windows version has been found, therefore, during the download process, both 64-bit and 32-bit windows versions download the 32-bit version and the msi installation package. Another URL is mongodb native driver 1.x: Click to open the link.

3. Install

Run the installation package directly and install it in the default path. The directory must be C: \ Program Files \ MongoDB 2.6 Standard.

4. Start directly

Run the console, cd to the C: \ Program Files \ MongoDB 2.6 Standard \ bin path, and then run the following:

> Mongod -- dbpath D: \ MongoDB

Note that the path followed by this path should be in full English, and it is best not to contain Chinese Characters

If you want to start the mongoDB shell command line, run

> Mongo

5. bat startup

Every time I enter the directory of a drive C and start mongoDB through running the console, it is quite troublesome, so we can write a STARTUP script.

As follows:

C: \ "Program Files" \ "MongoDB 2.6 Standard" \ bin \ mongod -- dbpath D: \ MongoDB \ data
Pause

It is worth noting that there is no space in the startup script. If there is a space in a directory, use "" to include it. pause is used to prevent the console from being automatically closed. The paths here are all absolute paths.

You can also start mongo shell to write a bat file, as shown below:

C: \ "Program Files" \ "MongoDB 2.6 Standard" \ bin \ mongo
Pause

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.