在打开一个单独的cmd窗口,使用mongo客户端连接到mongod
C:\Users\1636>d:\MongoDB\Server\3.0\bin\mongo.exe
2015-10-29T09:28:12.427+0800 I CONTROL Hotfix KB2731284 or later update is not installed, will zero-out data
files
MongoDB shell version: 3.0.6
connecting to: test //此时已连接成功
> db.version()
3.0.6
> show dbs
local 0.078GB
//如果此时需要停止mongod,则直接在原来的窗口使用ctrl+c即可1
3、将Mongodb添加为Windows服务
D:\>mkdir d:\MongoDB\data
D:\>mkdir d:\MongoDB\log
D:\> -- Author : Leshami
D:\> -- Blog :
D:\>echo logpath=d:\MongoDB\log\mongd.log> "d:\MongoDB\mongod.cfg"
D:\>echo dbpath=d:\MongoDB\data>> "d:\MongoDB\mongod.cfg"
D:\>type d:\MongoDB\mongod.cfg
logpath=d:\MongoDB\log\mongd.log
dbpath=d:\MongoDB\data
D:\>sc.exe create MongoDB binPath= "D:\MongoDB\Server\3.0\bin\mongod.exe --service --config=D:\MongoDB\mongod.cfg"
[SC] CreateService SUCCESS
D:\>net start MongoDB
The MongoDB service is starting.
The MongoDB service was started successfully.
D:\>net stop MongoDB
The MongoDB service is stopping.
The MongoDB service was stopped successfully.
4、修复Bug:Hotfix KB2731284
https://support.microsoft.com/zh-cn/kb/2731284
Linux下快速安装MongoDB
更多MongoDB相关内容可以看看以下的有用链接:
CentOS编译安装MongoDB
CentOS 编译安装 MongoDB与mongoDB的php扩展
CentOS 6 使用 yum 安装MongoDB及服务器端配置
Ubuntu 13.04下安装MongoDB2.4.3
《MongoDB 权威指南》(MongoDB: The Definitive Guide)英文文字版[PDF]
基于CentOS 6.5操作系统搭建MongoDB服务 uxidc.com/Linux/2014-11/108900.htm