MongoDB installation has a variety of installation methods, there is a direct use of homebrew mode, but also the source code compiled way. The simplest homebrew are used here.
1 using Brew to install MONGODB, you first need to make sure that you have homebrew installed on your computer and enter the following command at the terminal:
Ruby-e "$ (curl-fsskl raw.github.com/mxcl/homebrew/go)"
Install homebrew. (If you have already installed homebrew, you can skip this step)
2 After the brew is installed, update it first:
Brew Update
3 is then installed MongoDB:
Brew Install MongoDB
Wait a few minutes, if the terminal displays the following prompts, indicating that the MongoDB installation was successful.
4 Start MongoDB, enter at command line interface:
Mongod--config/usr/local/etc/mongod.conf
If there is no error, the Mongod service has started successfully
5 Use the MONGO command to connect to the database, open a new command line window, and then enter MONGO:
Mongo
At this point, the MongoDB database installation and connection is successful.