**
1.
** First enter the official website https://www.mongodb.com/download-center/community
The even version of mongoDB is the stable version and the odd version is the development version. Choose the version you want to install.
**
2.
** After
successful download, unzip the file to the / usr / local / directory, and rename the decompressed folder to MongoDB
ps: enter the / usr / local / directory available shortcut keys: shift+command+g
open the terminal and enter the open -e .bash_profile
configuration environment variable to the following Enter the path to bash_profile
export PATH="/usr/local/MongoDB/bin:$PATH"
stored command + s
is then input in the terminal source .bash_profile
and enter a carriage return after mongod -version
the figure below MongoDB then the version number has been successfully installed on the Mac
**
3
**
Create a data folder, and not automatically generated MongoDB installed, need to manually create
input terminal sudo mkdir -p /data/db
below a data folder will
open the input terminalmongo
Open the browser, enter localhost: 27017, this line of text will appear
It looks like you are trying to access MongoDB over HTTP on the native driver port.
The interface above shows the connection is successful startup!
If there is a connection failure exception: connect failed
error
First method: check / data / db folder location right, not to re-create a
second method: Enter the terminal brew services start mongodb
after the transport inputmongo
Close the connection,
use admin;
db.shutdownServer();