日期:2014-05-16  浏览次数:20499 次

mongodb 学习资料-1
 

1、先去http://www.mongodb.org/downloads 下载

这里使用的是2.0.7,xp系统, 

在c盘新建文件夹mongodb,下载后解压到这里(可自定义位置),在mongodb文件夹里新建data,logs文件夹,data为数据库存储位置,logs为日志文件存储位置。logs下新建mongodb.log

【配好环境变量C:\mongodb\bin】


进入cmd:

C:\Documents and Settings\Administrator>cd C:\mongodb\bin   


安装mongdb
C:\mongodb\bin>mongod --dbpath C:\mongodb\data --logpath C:\mongodb\logs\mongodb

.log --install

all output going to: C:\mongodb\logs\mongodb.log


启动mangodb数据库:
C:\mongodb\bin>mongod --dbpath C:\mongodb\data

Mon Sep 10 09:29:55
Mon Sep 10 09:29:55 warning: 32-bit servers don't have journaling enabled by def
ault. Please use --journal if you want durability.
Mon Sep 10 09:29:55
Mon Sep 10 09:29:55 [initandlisten] MongoDB starting : pid=4372 port=27017 dbpat
h=C:\mongodb\data 32-bit host=8SC3ZQDAFABDN6J
Mon Sep 10 09:29:55 [initandlisten]
Mon Sep 10 09:29:55 [initandlisten] ** NOTE: when using MongoDB 32 bit, you are
limited to about 2 gigabytes of data
Mon Sep 10 09:29:55 [initandlisten] ** see http://blog.mongodb.org/post/13
7788967/32-bit-limitations
Mon Sep 10 09:29:55 [initandlisten] ** with --journal, the limit is lower
Mon Sep 10 09:29:55 [initandlisten]
Mon Sep 10 09:29:55 [initandlisten] db version v2.0.7, pdfile version 4.5
Mon Sep 10 09:29:55 [initandlisten] git version: 875033920e8869d284f32119413543f
a475227bf
Mon Sep 10 09:29:55 [initandlisten] build info: windows sys.getwindowsversion(ma
jor=6, minor=0, build=6002, platform=2, service_p