标签:
Mongodb的安装与启动
下载链接:http://www.mongodb.org/downloads
第一步:下载安装包
第二步:在D盘下新建目录“D:\Mongodb”,把下载到的安装包解压缩,然后把bin目录copy到D:\Mongodb下
第三步:在“D:\Mongodb”目录下新建“data”文件夹,它将会成为数据存放的根目录。
C:\Documents and Settings\chenzhou>D: D:\>cd D:\Mongodb\bin D:\Mongodb\bin>mongod --dbpath D:\Mongodb\data
配置成功后会显示如下界面:
Mon Dec 12 19:32:49 Mon Dec 12 19:32:49 warning: 32-bit servers don‘t have journaling enabled by default. Please use --journal if you want urability. Mon Dec 12 19:32:49 Mon Dec 12 19:32:49 [initandlisten] MongoDB starting : pid=4220 port=27017 dbpath=D:\Mongodb\data 32-bit host=CY3379 Mon Dec 12 19:32:49 [initandlisten] Mon Dec 12 19:32:49 [initandlisten] ** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data Mon Dec 12 19:32:49 [initandlisten] ** see http://blog.mongodb.org/post/137788967/32-bit-limitations Mon Dec 12 19:32:49 [initandlisten] ** with --journal, the limit is lower Mon Dec 12 19:32:49 [initandlisten] Mon Dec 12 19:32:49 [initandlisten] db version v2.0.2-rc2, pdfile version 4.5 Mon Dec 12 19:32:49 [initandlisten] git version: 7d32bec61fd25e2d1e728e24d0d127a8a73e38e0 Mon Dec 12 19:32:49 [initandlisten] build info: windows (5, 1, 2600, 2, ‘Service Pack 3‘) BOOST_LIB_VERSION=1_42 Mon Dec 12 19:32:49 [initandlisten] options: { dbpath: "D:\Mongodb\data" } Mon Dec 12 19:32:49 [initandlisten] waiting for connections on port 27017 Mon Dec 12 19:32:49 [websvr] admin web console waiting for connections on port 28017 Mon Dec 12 19:33:49 [clientcursormon] mem (MB) res:14 virt:43 mapped:0
mongod --dbpath D:\Mongodb\data --port 10001
C:\Documents and Settings\chenzhou>D: D:\>cd Mongodb\bin D:\Mongodb\bin>mongo 127.0.0.1:27017 MongoDB shell version: 2.0.2-rc2 connecting to: 127.0.0.1:27017/test >
C:\Documents and Settings\chenzhou>D: D:\>cd Mongodb\bin D:\Mongodb\bin>mongo MongoDB shell version: 2.0.2-rc2 connecting to: test >
同样地,访问成功,连接到test库
标签:
原文地址:http://www.cnblogs.com/bafeiyu/p/5920603.html