mac上安裝mongodb資料庫教程

來源:互聯網
上載者:User

標籤:blog   http   io   os   java   ar   for   檔案   資料   

1.官網下載壓縮包,並解壓到當地任一目錄。(我的是Documents/develop/mongodb)

2.在mongodb下建立data檔案夾,在data下建立db檔案夾。(bin和data檔案夾在一級)

3.進入bin檔案夾,並設定資料庫資料存放的地址變數

cd Documents/develop/mongodb/bin

  

./mongod --dbpath /Users/wangming/Documents/develop/mongodb/data/db

  出現以下提示

2014-09-24T09:26:11.776+0800 [initandlisten] MongoDB starting : pid=1229 port=27017 dbpath=/Users/wangming/Documents/develop/mongodb/data/db 64-bit host=wangmingdeMacBook-Pro.local2014-09-24T09:26:11.776+0800 [initandlisten] 2014-09-24T09:26:11.776+0800 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 10002014-09-24T09:26:11.776+0800 [initandlisten] db version v2.6.42014-09-24T09:26:11.776+0800 [initandlisten] git version: 3a830be0eb92d772aa855ebb711ac91d658ee9102014-09-24T09:26:11.777+0800 [initandlisten] build info: Darwin bs-osx108-4 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_492014-09-24T09:26:11.777+0800 [initandlisten] allocator: system2014-09-24T09:26:11.777+0800 [initandlisten] options: { storage: { dbPath: "/Users/wangming/Documents/develop/mongodb/data/db" } }2014-09-24T09:26:11.785+0800 [initandlisten] journal dir=/Users/wangming/Documents/develop/mongodb/data/db/journal2014-09-24T09:26:11.785+0800 [initandlisten] recover : no journal files present, no recovery needed2014-09-24T09:26:11.800+0800 [FileAllocator] allocating new datafile /Users/wangming/Documents/develop/mongodb/data/db/local.ns, filling with zeroes...2014-09-24T09:26:11.800+0800 [FileAllocator] creating directory /Users/wangming/Documents/develop/mongodb/data/db/_tmp2014-09-24T09:26:11.829+0800 [FileAllocator] done allocating datafile /Users/wangming/Documents/develop/mongodb/data/db/local.ns, size: 16MB,  took 0.029 secs2014-09-24T09:26:11.899+0800 [FileAllocator] allocating new datafile /Users/wangming/Documents/develop/mongodb/data/db/local.0, filling with zeroes...2014-09-24T09:26:12.075+0800 [FileAllocator] done allocating datafile /Users/wangming/Documents/develop/mongodb/data/db/local.0, size: 64MB,  took 0.176 secs2014-09-24T09:26:12.193+0800 [initandlisten] build index on: local.startup_log properties: { v: 1, key: { _id: 1 }, name: "_id_", ns: "local.startup_log" }2014-09-24T09:26:12.194+0800 [initandlisten]  added index to empty collection2014-09-24T09:26:12.194+0800 [initandlisten] command local.$cmd command: create { create: "startup_log", size: 10485760, capped: true } ntoreturn:1 keyUpdates:0 numYields:0  reslen:37 394ms2014-09-24T09:26:12.194+0800 [initandlisten] waiting for connections on port 270172014-09-24T09:26:23.841+0800 [initandlisten] connection accepted from 127.0.0.1:50778 #1 (1 connection now open)2014-09-24T09:26:23.841+0800 [conn1] end connection 127.0.0.1:50778 (0 connections now open)2014-09-24T09:26:23.994+0800 [initandlisten] connection accepted from 127.0.0.1:50780 #2 (1 connection now open)2014-09-24T09:26:23.994+0800 [conn2] end connection 127.0.0.1:50780 (0 connections now open)2014-09-24T09:27:11.814+0800 [clientcursormon] mem (MB) res:33 virt:26532014-09-24T09:27:11.814+0800 [clientcursormon]  mapped (incl journal view):1602014-09-24T09:27:11.814+0800 [clientcursormon]  connections:02014-09-24T09:28:13.996+0800 [initandlisten] connection accepted from 127.0.0.1:50789 #3 (1 connection now open)2014-09-24T09:32:11.887+0800 [clientcursormon] mem (MB) res:33 virt:26532014-09-24T09:32:11.887+0800 [clientcursormon]  mapped (incl journal view):1602014-09-24T09:32:11.887+0800 [clientcursormon]  connections:12014-09-24T09:37:11.960+0800 [clientcursormon] mem (MB) res:33 virt:26532014-09-24T09:37:11.960+0800 [clientcursormon]  mapped (incl journal view):1602014-09-24T09:37:11.960+0800 [clientcursormon]  connections:1

 4.command+T建立一個終端視窗,在bin檔案下輸入./mongo指令

MongoDB shell version: 2.6.4connecting to: testWelcome to the MongoDB shell.For interactive help, type "help".For more comprehensive documentation, seehttp://docs.mongodb.org/Questions? Try the support grouphttp://groups.google.com/group/mongodb-userServer has startup warnings: 2014-09-24T09:26:11.776+0800 [initandlisten] 2014-09-24T09:26:11.776+0800 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000

   至此,ok了。

 

mac上安裝mongodb資料庫教程

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.