配置本地环境之Mongodb在WindowsXP下安装及配置
今天看了一本关于nodejs 的书籍,里面有要求使用mongoDB数据库的相关知识。了解这些知识之前,还是要先安装一下mongoDB。下面就是安装的相关步骤,希望能对大家在安装mongoDB有所帮助。 1、下载mongoDB 根据自己电脑的系统配置,下载mongoDB的版本。由于我电
今天看了一本关于nodejs 的书籍,里面有要求使用mongoDB数据库的相关知识。了解这些知识之前,还是要先安装一下mongoDB。下面就是安装的相关步骤,希望能对大家在安装mongoDB有所帮助。
1、下载mongoDB
根据自己电脑的系统配置,下载mongoDB的版本。由于我电脑是XP系统的,所以先用XP系统安装作为案例。下载地址:http://www.mongodb.org/downloads
2、解压mongoDB
下载完成之后,下载目录会多一个压缩包。解压到自己想要安装mongoDB的目录。比如D:盘中。(如图1-1)
图1-1
3、建立工作目录
(1) 建立数据存目录 :D:\mongodb\data\db
(2) 建立日志文件夹 :D:\mongodb\log。mongodb.log不需要我们手动创建。
4、启动mongoDB服务
在开始运行中输入cmd进入控制台。先输入d:进入安装目录的盘,然后输入cd mongoDB进入文件件,在进入bin文件夹,并输入
mongod.exe --dbpath=D:\mongodb\data\db
成功后会出现如下图片

打开http://127.0.0.1:27017/,如下图

如上所示。命令窗口会出现一系列信息,最末尾一行是 connection accepted from 127.0.0.1:53110 #1,过一会(本操作环境大概花费20s)会出现mem (MB) res:16 virt:81 mapped:0,代表已经启动成。正常运行应该显示以下内容。大家可输入地址:http://localhost:27017/,页面会出现如下结果:
You are trying to access MongoDB on the native driver port. For http diagnostic access, add 1000 to the port number
5、MongoDB安装为windows服务
新建控制台,并在 D:\mongodb\bin中输入
<!--[if gte mso 9]><![endif]--><!--[if gte mso 9]><![endif]--><p class="p0">mongod --logpath D:/mongodb/log/mongodb.log --logappend --dbpath D:/mongodb/data/db --directoryperdb --serviceName mongodb --install</p>
正确情况下显示以下内容
all output going to: E:\mongodb\logs\mongodb.log
成功后会出现如下图所示

开启服务,输入命令。
net start mongodb
显示内容
Mongo DB 服务已经启动成功。
成功后会出现如下图所示

在计算机 管理 服务中显示如下

6、容易出现的错误
(1) 初次安装mongoDB的时候,若有Mon Nov 18 19:00:00 [clientcursormon] mem (MB) res:1 virt:44 mapped:0或[conn3] end connection 127.0.0.1:3207是正常现象,再需要在控制台输入可以新启动一个控制台。只要是在http://localhost:27017/页面出现如下结果:
You are trying to access MongoDB on the native driver port. For http diagnostic access, add 1000 to the port number 就是安装成功了
(2) 若在控制台当按完回车之后出现,“mongod.exe”不是内部或外部命令,也不是可运行的程序或批处理文件时候,检查一下运行环境,应该是在D:mongodb\bin>输入
(3) 若出现can't open [D:mongodb\log\mongodb.log] for log file:errno 2,必须见建立日志目录的时候,不要建mongoDB.log文件即可。不然会报错如下
D:\mongodb>mongod --dbpath d:\mongodb\data\db --logpath d:\mongodb\log\mongodb.log all output going to: d:\mongodb\log\mongodb.log can't open [d:\mongodb\log\mongodb.log] for log file: errno:2 绯荤粺鎵句笉鍒版寚 瀹氱殑鏂囦欢銆 Wed Jun 06 23:27:20 dbexit: Wed Jun 06 23:27:20 shutdown: going to close listening sockets... Wed Jun 06 23:27:20 shutdown: going to flush diaglog... Wed Jun 06 23:27:20 shutdown: going to close sockets... Wed Jun 06 23:27:20 shutdown: waiting for fs preallocator... Wed Jun 06 23:27:20 shutdown: closing all files... Wed Jun 06 23:27:20 closeAllFiles() finished Wed Jun 06 23:27:20 dbexit: really exiting now
配置本地环境之Mongodb在Windows XP下安装及配置,就为大家介绍到这里。mongoDB在XP系统下的安装就为大家介绍到这里,希望能对大家有所帮助。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

It is recommended to use the latest version of MongoDB (currently 5.0) as it provides the latest features and improvements. When selecting a version, you need to consider functional requirements, compatibility, stability, and community support. For example, the latest version has features such as transactions and aggregation pipeline optimization. Make sure the version is compatible with the application. For production environments, choose the long-term support version. The latest version has more active community support.

Node.js is a server-side JavaScript runtime, while Vue.js is a client-side JavaScript framework for creating interactive user interfaces. Node.js is used for server-side development, such as back-end service API development and data processing, while Vue.js is used for client-side development, such as single-page applications and responsive user interfaces.

The data of the MongoDB database is stored in the specified data directory, which can be located in the local file system, network file system or cloud storage. The specific location is as follows: Local file system: The default path is Linux/macOS:/data/db, Windows: C:\data\db. Network file system: The path depends on the file system. Cloud Storage: The path is determined by the cloud storage provider.

Detailed steps to install Go language on Win7 computer Go (also known as Golang) is an open source programming language developed by Google. It is simple, efficient and has excellent concurrency performance. It is suitable for the development of cloud services, network applications and back-end systems. . Installing the Go language on a Win7 computer allows you to quickly get started with the language and start writing Go programs. The following will introduce in detail the steps to install the Go language on a Win7 computer, and attach specific code examples. Step 1: Download the Go language installation package and visit the Go official website

The MongoDB database is known for its flexibility, scalability, and high performance. Its advantages include: a document data model that allows data to be stored in a flexible and unstructured way. Horizontal scalability to multiple servers via sharding. Query flexibility, supporting complex queries and aggregation operations. Data replication and fault tolerance ensure data redundancy and high availability. JSON support for easy integration with front-end applications. High performance for fast response even when processing large amounts of data. Open source, customizable and free to use.

Installing Go language under Win7 system is a relatively simple operation. Just follow the following steps to successfully install it. The following will introduce in detail how to install Go language under Win7 system. Step 1: Download the Go language installation package. First, open the Go language official website (https://golang.org/) and enter the download page. On the download page, select the installation package version compatible with Win7 system to download. Click the Download button and wait for the installation package to download. Step 2: Install Go language

MongoDB is a document-oriented, distributed database system used to store and manage large amounts of structured and unstructured data. Its core concepts include document storage and distribution, and its main features include dynamic schema, indexing, aggregation, map-reduce and replication. It is widely used in content management systems, e-commerce platforms, social media websites, IoT applications, and mobile application development.

Essential PHP programs: Install these to run smoothly! PHP is a popular server-side scripting language that is widely used to develop web applications. To successfully run a PHP program, you first need to install some necessary software and tools on the server. In this article, we will introduce the software and tools that must be installed, along with specific code examples to help you run PHP programs smoothly. 1. PHP interpreter The core of the PHP program is the PHP interpreter, which is responsible for parsing and executing PHP code. To install the PHP interpreter, you can follow
