Mongo DB 是目前在IT行业非常流行的一种非关系型数据库(NoSql),其灵活的数据存储方式备受当前IT从业人员的青睐。Mongo DB很好的实现了面向对象的思想(OO思想),在Mongo DB中 每一条记录都是一个Document对象。Mongo DB最大的优势在于所有的数据持久操作都无需开发人员手动编写SQL语句,直接调用方法就可以轻松的实现CRUD操作。
下载地址
官网
下载完成后双击运行,以下是安装截图:
安装完成后,进入安装目录找到bin文件夹,在bin文件夹打开命令行(进入bin文件夹可在地址栏输入cmd直接进入命令行),输入:
代码语言:javascript复制mongod --dbpath D:MongoDBdata
前提是文件路径是已经创建好的。
以下是输入:
代码语言:javascript复制C:Program FilesMongoDBServer3.0bin>mongod --dbpath D:MongoDBdata
2015-06-29T13:09:24.094 0800 I CONTROL Hotfix KB2731284 or later update is not
installed, will zero-out data files
2015-06-29T13:09:24.098 0800 I STORAGE [initandlisten] exception in initAndList
en: 29 Data directory D:MongoDBdata not found., terminating
2015-06-29T13:09:24.098 0800 I CONTROL [initandlisten] dbexit: rc: 100
C:Program FilesMongoDBServer3.0bin>mongod --dbpath D:MongoDBdata
2015-06-29T13:09:35.794 0800 I CONTROL Hotfix KB2731284 or later update is not
installed, will zero-out data files
2015-06-29T13:09:35.811 0800 I JOURNAL [initandlisten] journal dir=D:MongoDBd
atajournal
2015-06-29T13:09:35.812 0800 I JOURNAL [initandlisten] recover : no journal fil
es present, no recovery needed
2015-06-29T13:09:35.846 0800 I JOURNAL [durability] Durability thread started
2015-06-29T13:09:35.846 0800 I JOURNAL [journal writer] Journal writer thread s
tarted
2015-06-29T13:09:35.860 0800 I CONTROL [initandlisten] MongoDB starting : pid=7
236 port=27017 dbpath=D:MongoDBdata 64-bit host=shy-PC
2015-06-29T13:09:35.860 0800 I CONTROL [initandlisten] targetMinOS: Windows 7/W
indows Server 2008 R2
2015-06-29T13:09:35.861 0800 I CONTROL [initandlisten] db version v3.0.4
2015-06-29T13:09:35.861 0800 I CONTROL [initandlisten] git version: 0481c958dae
b2969800511e7475dc66986fa9ed5
2015-06-29T13:09:35.862 0800 I CONTROL [initandlisten] OpenSSL version: OpenSSL
1.0.1m-fips 19 Mar 2015
2015-06-29T13:09:35.863 0800 I CONTROL [initandlisten] build info: windows sys.
getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Servic
e Pack 1') BOOST_LIB_VERSION=1_49
2015-06-29T13:09:35.864 0800 I CONTROL [initandlisten] allocator: tcmalloc
2015-06-29T13:09:35.864 0800 I CONTROL [initandlisten] options: { storage: { db
Path: "D:MongoDBdata" } }
2015-06-29T13:09:35.867 0800 I INDEX [initandlisten] allocating new ns file D
:MongoDBdatalocal.ns, filling with zeroes...
2015-06-29T13:09:36.029 0800 I STORAGE [FileAllocator] allocating new datafile
D:MongoDBdatalocal.0, filling with zeroes...
2015-06-29T13:09:36.030 0800 I STORAGE [FileAllocator] creating directory D:Mo
ngoDBdata_tmp
2015-06-29T13:09:36.291 0800 I STORAGE [FileAllocator] done allocating datafile
D:MongoDBdatalocal.0, size: 64MB, took 0.259 secs
2015-06-29T13:09:36.411 0800 I NETWORK [initandlisten] waiting for connections
on port 27017
2015-06-29T13:09:54.128 0800 I NETWORK [initandlisten] connection accepted from
127.0.0.1:54697 #1 (1 connection now open)
2015-06-29T13:09:54.129 0800 I NETWORK [initandlisten] connection accepted from
127.0.0.1:54698 #2 (2 connections now open)
2015-06-29T13:09:54.150 0800 I NETWORK [conn1] end connection 127.0.0.1:54697 (
1 connection now open)
2015-06-29T13:09:54.183 0800 I NETWORK [conn2] end connection 127.0.0.1:54698 (
0 connections now open)
不要关闭窗口在浏览器输入http://localhost:27017/,如果出现如下页面表示安装成功
如果不想每次运行都要进入安装目录,可以将安装目录的bin文件夹配置到环境变量中,在环境变量的path结尾加入
代码语言:javascript复制;C:Program FilesMongoDBServer3.0bin
即可。
这里是一个介绍常用命令的博客