Tutorial on installing MongoDB in Windows 32-bit system, Windows 32 MongoDB

Source: Internet
Author: User

Tutorial on installing MongoDB in Windows 32-bit system, Windows 32 MongoDB

I have encountered a pile of pitfalls when installing MongoDB in Windows 32-bit system.

1. Download MongoDB

Open the official website: https://www.mongodb.com/download-center#community

Corresponding to four platforms: windows, Linux, OSX, and Solaris

For windows systems, we naturally want to download data on windows platforms. However, I found that there is no 32-bit MongoDB on windows platforms. Later, I simply downloaded the first one, as a result, an error is reported directly during installation. The error is as follows:

After several analyses and blog searches, we found that MongoDB's latest document version 3.4.4 does not support win7 32-bit, therefore, if you are a Windows 3.4 32-bit system, do not install version or later.

However, you can download version 3.2, but the default drop-down box does not contain version 3.2. Please click below:

Get the list of all versions:

It is verified that 3.2.4 is usable. You can download 3.2.4-signed directly. msi is the installation file. You can directly double-click it to install it, or download the zip file and decompress it directly. Both of them need configuration at last, so it doesn't matter which one to download.

Ii. Install 3.2.4-signed. msi database software

I downloaded the msi file directly and double-click it to install it. After the installation is successful, it is only installed in the C: \ Program Files \ MongoDB \ location, we also need a series of configurations.

Although many blogs allow you to configure on CMD, We will skip this step and create a configuration file directly.

3. Configure MongoDB

A. Create a data folder c: \ MongoDB \ data under c: \ MongoDB (which can be started at Will)

B. Create a logs folder c: \ MongoDB \ logs under c: \ MongoDB (which can be started at will), and create a file mongo. log in it.

C. Create an etc folder c: \ MongoDB \ etc under c: \ MongoDB (which can be set as needed) and a file mongo. conf in it

D. Open the mongo. conf file and modify it as follows:

After completing the above operations, we can start our mongo database.

I specified a storage engine, which is usually not needed. However, my computer reported an error, storage engine 'wiredtiger '. After searching for a blog, you need to add the specified engine: storageEngine = mmapv1

If you are windows 64-bit, you may not need to specify it. If you are on another platform, such as linux or osx, you may not need to specify it.

Note:

The above configuration is used to start our MongoDB. You can also pass the parameters directly at startup as follows:

Mongod-dbpath c: \ MongoDB \ data-logpath c: \ MongoDB \ log \ mongo. log-journal

4. Start Mongo by passing parameters in the command

1. First, find cmd.exe and right-click the Administrator to run

2. Go to the installation folder and directly access the bindirectory (with mongod.exe included ).

3. Start mongo in a simple way (this method is in the form of a command and the parameter is passed in at the same time. In fact, we only need to start the above configuration file)

Mongod-dbpath c: \ MongoDB \ data

If you see waiting for connections on port 27017, it indicates that the instance is successfully started. Then, we can test it.

The figure shows that the instance is successfully started.

4.next, find cmd.exe, right-click the administrator, and enter the bin directory of mongo again (because I have not configured any environment variables, so I need to go to the bin directory for execution). Enter mongo and press Enter.

As shown in, you have entered the mongo command. Here, you can use the mongo command to perform a series of database operations.

5. Start MongoDB in the form of a configuration file and install it in the window service.

1. Go to the bin directory under the mongodb installation directory:

Cd c: \ Program Files \ apsaradb for MongoDB \ Server \ 3.2 \ bin>

2. Enter the command to start mongo.

Mongod-config c: \ MongoDB \ etc \ mongo. conf-install-serviceName "MongoDB"

After the installation is successful, open the window service and we can see that MongoDB has been installed in it.

Every day, we only need to start the service. If you do not install this service, you can also manually enter the installation directory and enter the command to start each time you start the service, both methods are supported.

Delete the service command: mongod-config c: \ MongoDB \ etc \ mongo. conf-remove, refresh the service, and you will find that the service has been deleted.

In addition, if you do not want to enter the installation directory, you can configure the Mongo environment variables so that you do not need to start the installation directory every time.

Environment variable configuration method:

1. Right-click the computer on the desktop and select Properties

2. In the pop-up panel, select Advanced System settings

3. Select the advanced option in the pop-up box. The environment variable button is shown below.

4. Find the system environment variable, open path, and enter C: \ Program Files \ MongoDB \ Server \ 3.2 \ bin in it (note that there is a semicolon in front)

At this point, we have successfully installed mongo under Windows 7 32-bit. If your computer is not win7 32-bit or 64-bit, you can directly download and install mongo, the configuration is basically the same as that of me.

If it is not a windows platform, you only need to select the corresponding platform. The configuration is the same as that of windows 7.

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.