原文出自:http://www.mkyong.com/mongodb/how-to-install-mongodb-on-windows/
返回目录:http://ysj5125094.iteye.com/blog/2192754
How To Install MongoDB On Windows
In this tutorial, we will show you how to install MongoDB on Windows.
译:在本教程中,我们将告诉你如何在Windows上安装MongoDB。
- MongoDB 2.2.3
- Windows 7
Note
The MongoDB does not require installation, just download and extracts the zip file, configure the data directory and start it with command “mongod
“.
译:注,MongoDB不需要安装,只要下载并提取ZIP文件,配置数据目录,使用"mongod"命令启动。
1. Download MongoDB
Download MongoDB from official MongoDB website. Choose Windows 32 bits or 64 bits. Unzip, extracts to your prefer location, for example : d:\mongodb\
.
译:从官方网站MongoDB website下载MongoDB。选择Windows 32位或64位。解压,提取到你喜欢的位置,例如:D:\mongodb\。
2. Review MongoDB folder
In MongoDB, it contains only 10+ executable files (exe) in the bin folder. This is true, and that are the required files to MongoDB, it’s really hard to believe for a developer like me who come from a relation database background.
译:在MongoDB中,它仅包含10 +可执行文件(EXE),都在Bin文件夹中。对于一个来自关系型数据库背景的人来说,这真是一件很难的事情。
Figure : Files under $MongoDB/bin folder
图:$MongoDB/bin 文件夹下的所有文件。
Note
It’s recommended to add $MongoDB/bin
to Windows environment variable, so that you can access the MongoDB’s commands in command prompt easily.
译:注,建议增加 $MongoDB / bin 的Windows环境变量,这样你可以在命令提示符下很容易的使用MongoDB命令。
3. Configuration File
Create a MongoDB config file, it’s just a text file, for example : d:\mongodb\mongo.config
译:创建MongoDB配置文件,他可以只是一个文本文件,例如:D:\ mongodb \ mongo.config
d:\mongodb\mongo.config
##store data here dbpath=D:\mongodb\data ##all output go here logpath=D:\mongodb\log\mongo.log ##log read and write operations diaglog=3
Note
MongoDB need a folder (data directory) to store its data. By default, it will store in “C:\data\db
“, create this folder manually. MongoDB won’t create it for you. You can also specify an alternate data directory with --dbpath
option.
译:MongoDB需要一个文件夹(数据目录)来存储它的数据。默认情况下,它将存储在“C:\data\db”,你需要手动创建该文件夹。MongoDB不会为你创造它。你也可以指定一个数据目录——dbpath 选项。
4. Run MongoDB server
Use mongod.exe --config d:\mongodb\mongo.config
to start MongoDB server.
译:使用mongod.exe --config d:\mongodb\mongo.config命令来启动MongoDB服务器。
d:\mongodb\bin>mongod --config D:\mongodb\mongo.config all output going to: D:\mongodb\log\mongo.log
5. Connect to MongoDB
Uses mongo.exe
to connect to the started MongoDB server.
译:使用mongo.exe命令连接到已经启动的MongoDB服务器。
d:\mongodb\bin>mongo MongoDB shell version: 2.2.3 connecting to: test > //mongodb shell
6. MongoDB as Windows Service
Add MongoDB as Windows Service, so that MongoDB will start automatically following each system restart.
译:添加MongoDB作为Windows服务,使MongoDB会在每次系统重新启动时自动启动。
Install as Windows Service with --install
.
d:\mongodb\bin> mongod --config D:\mongodb\mongo.config --install
A Windows service named “MongoDB” is created.
译:一个windows服务已经创建,名为"MongoDB"。
To start MongoDB Service
net start MongoDB
To stop MongoDB Service
net stop MongoDB
To remove MongoDB Service
d:\mongodb\bin>mongod --remove
7. FAQs
1. Install MongoDB as Windows service on Windows 8, but hit “Access is denied.” error message :
译:在windows8中为MongoDB安装windows服务,但是遇到"访问被拒绝"错误消息。
C:\Users\mkyong2002>mongod --config D:\mongodb\mongo.config --install Tue Jul 16 21:05:55.154 diagLogging level=3 Tue Jul 16 21:05:55.155 diagLogging using file D:\mongodb\data/diaglog.51e54533 Tue Jul 16 21:05:55.155 Trying to install Windows service 'MongoDB' Tue Jul 16 21:05:55.155 Error connecting to the Service Control Manager: Access is denied. (5)
To fix it, run the Command Prompt with Administrative Privileges – right click on the command prompt icon, select run as administrator.
译:修复,右键运行命令提示符图标,管理权限,以管理员身份运行。
References
相关推荐
《Windows上安装MongoDB:完整步骤详解.pdf》是一份适用于Windows操作系统的MongoDB安装教程,适用于初学者和有经验的开发人员。本教程包括完整的步骤详解,可帮助您快速掌握MongoDB的安装配置,包括环境变量设置,...
Windows 平台安装 MongoDB:MongoDB 下载;命令行下运行 MongoDB 服务器;将MongoDB服务器作为Windows服务运行;MongoDB后台管理 Shell。
介绍详细讲解在Mac上安装MongoDB数据库,配置环境变量、数据以及日志,快速启动和停止。
如何在windows上面安装mongodb数据库 单机版安装 已经亲自测试安装成功。
php5.3(ts+vc9)+mongodb.zip 在wamp中安装mongodb 并添加到系统服务启动
windows下mongodb数据库的安装
安装MongoDB并注册成windows服务
windows安装及简单配置mongodb3.6 windows安装及简单配置mongodb3.6 windows安装及简单配置mongodb3.6
Centos7下安装MongoDB
1.NoSQL Manager for MongoDB使用.doc 2.最详细的Windows平台安装MongoDB教程.doc 3.安装包:mongodb-windows-x86_64-4.4.1-signed.msi
非常简单的Windows下的MongoDB配置。没有讲述安装明细。管理员下命令行启动MongoDB
在Windows环境下MongoDB搭建和简单操作,文档描述简单明了。
文中的系统版本: centos7.7 参阅官网 link 1.创建源 sudo vim /etc/yum.repos.d/mongodb-org-4.2.repo 写入: [mongodb-org-4.2] name=MongoDB Repository baseurl=...2.执行安装 因为我们此处只
本教材为redhat linux 4系统下安装mongodb 32位版本,mongodb是一个文件数据库,其他linux系统下安装都是类似的。
windows下mongodb安装与使用整理
mongodb-windows-64mongodb-windows-64mongodb-windows-64
mongodb_x64位windows安装版本,官方正版,mongodb_x64位windows安装版本,官方正版
Windows7-安装MongoDB,非常实用详细的MongoDB安装文档!
MongoDB 是目前在IT行业非常流行的一种非关系型数据库(NoSql),其灵活的数据存储方式备受当前IT从业人员的青睐。这里主要讲如何在windows平台下安装MongoDB。
centos7 下安装MongoDB