隨筆-193  評論-715  文章-1  trackbacks-0
          Reference page: Http://docs.mongodb.org/master/tutorial/install-mongodb-on-os-x/

          1, install brew, if it is exist, skip this step.
          Reference page:  http://mxcl.github.com/homebrew/
          Execute the following command:
          #/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"

          2, install MongoDB:
          #brew update
          #brew install mongodb

          3, use mondod command to startup MongoDB
          #nohup mongod &

          4, enter mongo shell for testing:
          #mongo

          MongoDB shell version: 2.0.5
          connecting to: test
          > db.test.save({a:1})
          > db.test.find()
          { "_id" : ObjectId("4fca4824293f5115fa740813"), "a" : 1 }

          5, GUI client recommendations:

          MongoExplorer
          MongoHub

          6, MongoDB has provided a web base management inerface:
          http://localhost:28017/

          7, export and import:
          $ mongodump -h test.xxxx.com:52000 -d dataname -o /home/aa/dev/mongodb/data

          mongodump mongo導出數據庫命令 mongodump --help 可以查看該命令下所有的幫助

          -h 導出源
          -d 要導出的數據庫名稱
          -o 數據庫要導出的位置

          在終端滾過N行之后,數據庫導出完成,可以去/home/aa/dev/mongodb/data 目錄下查看導出的文件,bson格式的(我導出后沒有馬上就看到文件,等了一會才出現的,原因不明)

          然后數據庫恢復使用:mongorestore 命令

          $ mongorestore -d cmsdev  /home/xx/dev/mongodb/data/cmsdev

          -d 使用的數據庫名稱
          后面直接加你剛才導出的目錄,這樣是直接恢復所有表

          如果-c 是恢復一個表
          posted on 2012-06-03 01:15 Robin's Programming World 閱讀(1636) 評論(0)  編輯  收藏 所屬分類: 其它
          <2012年6月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          1234567

          常用鏈接

          留言簿(49)

          隨筆分類(215)

          隨筆檔案(181)

          相冊

          收藏夾

          Friend Links

          • Tiger的Blog,專注于過程改進,項目管理,質量管理三個方向。
          • zrfunds

          搜索

          •  

          積分與排名

          • 積分 - 754872
          • 排名 - 60

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 嵊州市| 泸定县| 丰宁| 岳阳县| 平湖市| 灵武市| 宿松县| 兴义市| 布尔津县| 罗定市| 桃园县| 邳州市| 武平县| 邹城市| 郸城县| 巫山县| 昂仁县| 云南省| 南澳县| 桃江县| 平江县| 石台县| 安国市| 卓尼县| 资中县| 宁化县| 历史| 禄丰县| 鸡西市| 南郑县| 托克逊县| 兰考县| 阜平县| 洪江市| 酉阳| 嵊州市| 安丘市| 平武县| 思茅市| 临漳县| 清苑县|