mongodb 學習資料-1

來源:互聯網
上載者:User

 

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_pack='Service Pack 2') BOOST_LIB
_VERSION=1_42
Mon Sep 10 09:29:55 [initandlisten] options: { dbpath: "C:\mongodb\data" }
Mon Sep 10 09:29:55 [websvr] admin web console waiting for connections on port 2
8017
Mon Sep 10 09:29:55 [initandlisten] waiting for connections on port 27017
 

表示啟動成功,連接埠預設為27017

瀏覽器輸入:http://localhost:27017/      

顯示:

You are trying to access MongoDB on the native driver port. For http diagnostic access, add 1000 to the port number

表示成功了


相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.