Yosemite安裝Mongodb小記
最近學習mongodb,安裝mongodb的時候,本想使用Homebrew簡便的方式進行安裝。可是發現在升級到Mac OS X10.10後,Homebrew突然不能用了。小折騰了一下,小記如下:
1. 解除安裝Homebrew
貌似是ruby版本的問題,我的解決方法就是解除安裝重灌,簡單粗暴,不過也可以參照Mac OS X 10.10 Yosemite 開發者升級指南之Homebrew 。解除安裝Homebrew命令為:rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
2. 重新安裝Homebrew
Mac-mini:~ pengloo53$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
Mac-mini:~ pengloo53$
Mac-mini:~ pengloo53$ rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
Mac-mini:~ pengloo53$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
Press RETURN to continue or any other key to abort
==> Downloading and installing Homebrew...
remote: Counting objects: 229572, done.
remote: Compressing objects: 100% (60208/60208), done.
remote: Total 229572 (delta 168116), reused 229559 (delta 168108)
Receiving objects: 100% (229572/229572), 52.53 MiB | 37.00 KiB/s, done.
Resolving deltas: 100% (168116/168116), done.
From https://github.com/Homebrew/homebrew
* [new branch] master -> origin/master
HEAD is now at 4842aa9 ht: basic test added
==> Installation successful!
3. 檢查錯誤
執行brew doctor
,如果報錯如下請接著往下走,不然跳過第4步
4. 升級XQuartz
在官網下載最新版本XQuartz
5. 更新相關元件
執行命令brew update
Mac-mini:~ pengloo53$ brew update
Updated Homebrew from c83f453a to 9a0fbf6a.
==> Updated Formulae
botan git-annex jpeg-turbo mpd spoof-mac x264
d-bus gnu-getopt libraw node v8
geoip iojs moreutils notmuch vnu
6. 安裝mongodb
通過Homebrew安裝mongodb,執行brew install mongodb
Mac-mini:~ pengloo53$ brew install mongodb
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/mongodb-2.6
Already downloaded: /Library/Caches/Homebrew/mongodb-2.6.7.yosemite.bottle.tar.gz
==> Pouring mongodb-2.6.7.yosemite.bottle.tar.gz
==> Caveats
To have launchd start mongodb at login:
ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents
Then to load mongodb now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
Or, if you don't want/need launchctl, you can just run:
mongod --config /usr/local/etc/mongod.conf
==> Summary
? /usr/local/Cellar/mongodb/2.6.7: 17 files, 332M
Mac-mini:~ pengloo53$ mongo --config /usr/local/etc/mongod.conf
Error parsing command line: unknown option config
try 'mongo --help' for more information
7. 啟動mongodb服務
命令列sudo mongod
,若報錯如下圖
手動建立/data/db檔案目錄,mkdir -p /data/db
,可能會報沒有許可權的錯誤,sudo !!
再執行一遍。重新啟動mongodb服務,sudo mongod
,正常情況應該沒有問題了,如下圖
8. 進入mongo
命令列mongo
,預設連線到了test資料庫,進入後,db.stats()
檢視資料庫相關資訊。
異常錯誤
如果報錯誤,errno61 Connection refused,請按照此步驟處理。MongoDB reason: errno:61 Connection refused - 推酷
相關文章
- 伺服器上安裝MongoDB小記伺服器MongoDB
- 安裝mongodbMongoDB
- mongodb 安裝MongoDB
- ArchLinux 安裝小記Linux
- yarn 安裝使用小記Yarn
- MongoDB | Linux 安裝MongoDBLinux
- 【mongodb安裝配置】MongoDB
- MAC 安裝 MongoDBMacMongoDB
- MongoDB的安裝MongoDB
- Docker安裝mongodbDockerMongoDB
- Ubuntu安裝和解除安裝mongodbUbuntuMongoDB
- proxysql安裝和使用小記SQL
- docker 安裝部署 supervisor 小記Docker
- iOS安裝包瘦身小記iOS
- 【隨手記錄】mongoDB離線安裝指令碼MongoDB指令碼
- ubuntu透過安裝包安裝MongodbUbuntuMongoDB
- Windows下安裝MongoDBWindowsMongoDB
- Mac下安裝MongodbMacMongoDB
- MongoDB安裝配置教程MongoDB
- docker-安裝mongodbDockerMongoDB
- 【MongoDB】安裝與配置MongoDB
- linux上安裝mongodbLinuxMongoDB
- win10 mongodb安裝教程_win10 mongodb安裝步驟Win10MongoDB
- Pycharm 個人安裝小記錄PyCharm
- Windows 11 安裝wsl小記錄Windows
- mongodb的安裝以及使用MongoDB
- MongoDB資料庫安裝MongoDB資料庫
- MongoDB下載與安裝MongoDB
- docker安裝mongoDB及使用DockerMongoDB
- Mac 安裝與配置mongodbMacMongoDB
- mac怎麼安裝mongodbMacMongoDB
- mongodb擴充套件安裝MongoDB套件
- CentOS7.7安裝mongodbCentOSMongoDB
- MongoDB日常運維-02安裝MongoDB運維
- 如何在 Ubuntu 上安裝 MongoDBUbuntuMongoDB
- CentOS7.2 安裝 MongoDB 3.4CentOSMongoDB
- windows安裝mongodb詳細教程WindowsMongoDB
- 快速掌握mongoDB(一)——mongoDB安裝部署和常用shell命令MongoDB
- Redis-3.2.1 sentinel安裝和配置小記Redis