Mac install MongoDB One is through homebrew, the other is the direct official website download package settings, here we say is the latter.
The main steps are: Download unzip, create folder, set permissions
1, download from the official website, the latest version is mongodb-osx-x86_64-3.0.5, unzip the file to a directory you want to place.
It's assumed to be placed under/USERS/XXX/MONGODB.
2. Create a new Data folder under/users/xxx/mongodb, create a new DB folder under Data 3, set permissions, and enter sudo chown-r/users/xxx/mongodb/mongodb-osx-x86_64-3.0.5/ Data 4, enter the/users/xxx/mongodb/mongodb-osx-x86_64-3.0.5/bin directory, set the DB folder path command, enter and return, Mongod--dbpath/users/skythinking/ MONGODB/MONGODB-OSX-X86_64-3.0.5/DATA/DB5. You should see waiting for connections on port 270176. Browser View localhost:27017, see it Looks like you is trying to access MongoDB over HTTP on the native driver port description is connected. environment variable settings: Enter sudo nano ~/.bash_profile enter login password
Export lo_home=/usr/local
Export Xye_home=/users/xy
Export Path=${path}:${lo_home}/mysql/bin
Export Path=${path}:${lo_home}/bin
Export Path=${path}:${xye_home}/mongodb/mongodb-osx-x86_64-3.0.5/bin
Input is shown for example above.
Control+o Save
Control+x exit
SOURCE ~/.bash_profile re-entry echo $PATH view environment variables
Install MongoDB under Mac OS