Mongodb database learning: installation of mongodb under windows7 system
The MongoDB software for Windows can be downloaded from https://www.mongodb.org/downloads.
Note: Mongodb 2.2 and later will no longer support Windows XP.
After the download is complete, start the installation. It is the same as other Windows software installations. There is one thing you need to pay attention to during the installation process. In the figure below, we can select the Custom option to customize some options. If you use the default configuration, you can select complete.
Here I changed the installation directory to drive D, as shown below
I won’t take screenshots of the following installation process, it’s just the normal installation of Windows software.
Set the directory where Mongodb stores data below:
The default directory for storing data in Mongodb is data/db. However, this directory will not be created automatically, so we need to create it manually. Create the data/db directory in the D drive.
Then create a new environment variable and add the mongodb installation directory/bin to the Path
Confirm completion, open the windows dos window, and enter the command mongod.exe –dbpath D:/data/db in the command line.
The following result indicates that the service is successfully started.
2015-12-21T16:14:13.633+0800 I - [initandlisten] Detected data files in D
:/data/db created by the 'mmapv1' storage engine, so setting the active storage
engine to 'mmapv1'.
2015-12-21T16:14:13.691+0800 I CONTROL [initandlisten]
2015-12-21T16:14:13.691+0800 I CONTROL [initandlisten] ** WARNING: This 32-bit
MongoDB binary is deprecated
2015-12-21T16:14:13.692+0800 I CONTROL [initandlisten]
2015-12-21T16:14:13.693+0800 I CONTROL [initandlisten]
2015-12-21T16:14:13.694+0800 I CONTROL [initandlisten] ** NOTE: This is a 32 bit
MongoDB binary.
2015-12-21T16:14:13.694+0800 I CONTROL [initandlisten] ** 32 bit builds a
re limited to less than 2GB of data (or less with --journal).
2015-12-21T16:14:13.695+0800 I CONTROL [initandlisten] ** Note that journ
aling defaults to off for 32 bit and is currently off.
2015-12-21T16:14:13.695+0800 I CONTROL [initandlisten] ** See http://doch
ub.mongodb.org/core/32bit
2015-12-21T16:14:13.696+0800 I CONTROL [initandlisten]
2015-12-21T16:14:13.704+0800 I NETWORK [HostnameCanonicalizationWorker] Startin
g hostname canonicalization worker
2015-12-21T16:14:13.704+0800 I FTDC [initandlisten] Initializing full-time d
iagnostic data capture with directory 'D:/data/db/diagnostic.data'
2015-12-21T16:14:13.708+0800 I NETWORK [initandlisten] waiting for connections
on port 27017
Next, configure the mongodb service as a windows system service
First, open the DOS window and enter the following command
> mkdir D:\data\log
Then start installing the service and enter in the Dos command line
> mongod.exe --logpath D:\data\log\mongod.log --dbpath D:\data\db -- install
After pressing Enter, the following result appears
2015-12-21T16:41:27.570+0800 I CONTROL [main]
2015-12-21T16:41:27.571+0800 W CONTROL [main] 32-bit servers don't have journal
ing enabled by default. Please use --journal if you want durability.
2015-12-21T16:41:27.571+0800 I CONTROL [main]
Description: Installation is successful
Then you can manage the mongodb service through the following command
> net start mongodb Start the mongodb service
> net stop mongodb shuts down the mongodb service
Finally, if you want to remove the service, you can use the following command
> Mongod.exe –remove
It can also be configured as a self-starting service under Windows, using the following command
> sc.exe create mongoDB bingPath=”Installation directory\bin\mongod.exe --service --logpath=\”D:\data\log\mongod.log\” --dbpath=\”D:\data\db\”” DisplayName=”mongoDB” start=”auto”
After success, the MongoDB service will be started every time the Windows system is started.
To delete a service, use the following command
> sc.exe delete mongoDB
So far, the method of installing mongodb under windows7 has been introduced. If you have any better suggestions, please leave a message below
For reprinting, please send an email to 1244347461@qq.com for approval. After obtaining the author's consent, kindly include the source as a link.
Related Articles
Mongodb database learning centos system mongodb installation chapter
Publish Date:2025/04/30 Views:200 Category:MongoDB
-
This article introduces the process of installing mongodb on Centos. The installation of software will definitely involve 32-bit and 64-bit. Since my system is 32-bit, I will use the 32-bit mongodb software here. You can choose the correspo
Storing images in MongoDB
Publish Date:2025/04/30 Views:193 Category:MongoDB
-
You can use a database to store pictures and other small images in a database table. Such picture files can be processed more efficiently on a file server. However, when image data is stored in a binary field, it can only be accessed by app
List all collections in MongoDB Shell
Publish Date:2025/04/29 Views:156 Category:MongoDB
-
When using MongoDB , there are several ways to list the collections in the database. This article will discuss four different ways to get a list of collections in a MongoDB database. These methods are as follows: show collections List all c
Querying for non-null values in MongoDB
Publish Date:2025/04/29 Views:139 Category:MongoDB
-
This MongoDB article will explain how to query for non-null values in MongoDB. To query for non-null values, you can use $ne the operator and $eq the operator and then specify the desired value to query. This article shows the readers
Shutting down with code:100 error in MongoDB
Publish Date:2025/04/29 Views:54 Category:MongoDB
-
This MongoDB tutorial will teach you to fix the error on different operating systems shutting down with code:100 . It will also talk about the root cause of why this issue occurs. shutting down with code:100 Errors in MongoDB As we all know
SELECT COUNT GROUP BY in MongoDB
Publish Date:2025/04/29 Views:75 Category:MongoDB
-
In this article, we will discuss the functions in MongoDB. Also, we will point out the aggregation functions in detail. We will explain in detail the different ways to count and sort multiple and single fields of Group in MongoDB. Operation
Differences between MongoDB and Mongoose
Publish Date:2025/04/29 Views:80 Category:MongoDB
-
This MongoDB article will discuss the differences between MongoDB and Mongoose. Unfortunately, most beginners tend to confuse these two concepts when they start developing applications and use MongoDB as their backend. MongoDB has its own s
Install MongoDB using Homebrew
Publish Date:2025/04/29 Views:161 Category:MongoDB
-
MongoDB is a well-known unstructured database management system that can handle large amounts of data. It is a document-oriented database system and belongs to the NoSQL family (non-SQL). Data and records are stored as documents that look a
Create a MongoDB dump of the database
Publish Date:2025/04/29 Views:63 Category:MongoDB
-
In this MongoDB article, you’ll get a walkthrough of Mongodump and Mongorestore , how to use them, and some simple examples of backing up and restoring your collections using both tools. mongodump Commands in MongoDB Mongodump is a tool t