search
HomeDatabaseMysql Tutorial配置本地环境之Mongodb在WindowsXP下安装及配置

配置本地环境之Mongodb在WindowsXP下安装及配置

Jun 07, 2016 pm 03:23 PM
mongodbwindowsxpInstalllocalenvironmentConfiguration

今天看了一本关于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)


配置本地环境之Mongodb在Windows XP下安装及配置

图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

  成功后会出现如下图片

配置本地环境之Mongodb在Windows XP下安装及配置

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

配置本地环境之Mongodb在Windows XP下安装及配置

  

  如上所示。命令窗口会出现一系列信息,最末尾一行是 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

  成功后会出现如下图所示

配置本地环境之Mongodb在Windows XP下安装及配置

  开启服务,输入命令。

net start mongodb

  显示内容

Mongo DB 服务已经启动成功。

  成功后会出现如下图所示

配置本地环境之Mongodb在Windows XP下安装及配置

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

配置本地环境之Mongodb在Windows XP下安装及配置

  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系统下的安装就为大家介绍到这里,希望能对大家有所帮助。


Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
MySQL's Place: Databases and ProgrammingMySQL's Place: Databases and ProgrammingApr 13, 2025 am 12:18 AM

MySQL's position in databases and programming is very important. It is an open source relational database management system that is widely used in various application scenarios. 1) MySQL provides efficient data storage, organization and retrieval functions, supporting Web, mobile and enterprise-level systems. 2) It uses a client-server architecture, supports multiple storage engines and index optimization. 3) Basic usages include creating tables and inserting data, and advanced usages involve multi-table JOINs and complex queries. 4) Frequently asked questions such as SQL syntax errors and performance issues can be debugged through the EXPLAIN command and slow query log. 5) Performance optimization methods include rational use of indexes, optimized query and use of caches. Best practices include using transactions and PreparedStatemen

MySQL: From Small Businesses to Large EnterprisesMySQL: From Small Businesses to Large EnterprisesApr 13, 2025 am 12:17 AM

MySQL is suitable for small and large enterprises. 1) Small businesses can use MySQL for basic data management, such as storing customer information. 2) Large enterprises can use MySQL to process massive data and complex business logic to optimize query performance and transaction processing.

What are phantom reads and how does InnoDB prevent them (Next-Key Locking)?What are phantom reads and how does InnoDB prevent them (Next-Key Locking)?Apr 13, 2025 am 12:16 AM

InnoDB effectively prevents phantom reading through Next-KeyLocking mechanism. 1) Next-KeyLocking combines row lock and gap lock to lock records and their gaps to prevent new records from being inserted. 2) In practical applications, by optimizing query and adjusting isolation levels, lock competition can be reduced and concurrency performance can be improved.

MySQL: Not a Programming Language, But...MySQL: Not a Programming Language, But...Apr 13, 2025 am 12:03 AM

MySQL is not a programming language, but its query language SQL has the characteristics of a programming language: 1. SQL supports conditional judgment, loops and variable operations; 2. Through stored procedures, triggers and functions, users can perform complex logical operations in the database.

MySQL: An Introduction to the World's Most Popular DatabaseMySQL: An Introduction to the World's Most Popular DatabaseApr 12, 2025 am 12:18 AM

MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.

The Importance of MySQL: Data Storage and ManagementThe Importance of MySQL: Data Storage and ManagementApr 12, 2025 am 12:18 AM

MySQL is an open source relational database management system suitable for data storage, management, query and security. 1. It supports a variety of operating systems and is widely used in Web applications and other fields. 2. Through the client-server architecture and different storage engines, MySQL processes data efficiently. 3. Basic usage includes creating databases and tables, inserting, querying and updating data. 4. Advanced usage involves complex queries and stored procedures. 5. Common errors can be debugged through the EXPLAIN statement. 6. Performance optimization includes the rational use of indexes and optimized query statements.

Why Use MySQL? Benefits and AdvantagesWhy Use MySQL? Benefits and AdvantagesApr 12, 2025 am 12:17 AM

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

Describe InnoDB locking mechanisms (shared locks, exclusive locks, intention locks, record locks, gap locks, next-key locks).Describe InnoDB locking mechanisms (shared locks, exclusive locks, intention locks, record locks, gap locks, next-key locks).Apr 12, 2025 am 12:16 AM

InnoDB's lock mechanisms include shared locks, exclusive locks, intention locks, record locks, gap locks and next key locks. 1. Shared lock allows transactions to read data without preventing other transactions from reading. 2. Exclusive lock prevents other transactions from reading and modifying data. 3. Intention lock optimizes lock efficiency. 4. Record lock lock index record. 5. Gap lock locks index recording gap. 6. The next key lock is a combination of record lock and gap lock to ensure data consistency.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools