Environment: Mac 10.11.6
First, installation steps: According to the official website of the tutorial:
1. Open terminal installation or upgrade brew:
Brew Update
2. Installing MongoDB binary files:
Brew Install MongoDB
If you need Tls/lls support:
Brew Install MongoDB--with-openssl
If you need the latest development version, use it for early adopters:
Brew Install MongoDB--devel
Wait for a moment and then you can.
Second, if you do not want to go through the command line, you can manually install:
1, to: Https://www.mongodb.org/downloads Download the appropriate version of the compression package. can also be in the terminal:
Curl-o https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.2.7.tgz
2. After successful download: Unpack the package with unzip command
TAR-ZXVF mongodb-osx-x86_64-3.2.7.tgz
3. Copy the extracted files to your own new directory:
For example: root directory under/mongodb
Mkdir-p MongoDB
Cp-r-N Mongodb-osx-x86_64-3.2.7/mongodb
4, switch to the directory to: CD ~/.BASHRC, open this file, some OS system may be: in ~/.bash_profile edit the following command line to add to the end of the file:
Export Path=/mongodb/bin: $PATH, execute source ~/.BASHRC to make configuration path valid
In most cases, the command line is recommended for quick and easy installation.
Third, the operation:
1, after the successful installation. In terminal execution:
Mkdir-p/data/db
Create a database path.
2. Input command line: Mongod
Start MongoDB and you'll see
Prove that the MongoDB service is ready.
Next, you can connect to the database.
In the browser, type: localhost:27017
See a line of hints:
It looks like you is trying to access MongoDB over HTTP on the native driver port.
Is the driver port that prompts you to connect to the database over HTTP
3. You can then switch to a new directory to open a new terminal and enter: MONGO 127.0.0.1:27017
See
Enter the MongoDB shell environment, where you can do some simple database operations.
Use student, the scripting environment will prompt you to switch to the student database.
As for how to clear the warning?? : reference
A warning appears after MONGODB installation: * * Warning:soft rlimits too low. Number of files is a, should be at least
MongoDB installation and startup simple to use