Download the installation package
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.6.tgz
Extract
TAR-ZXVF mongodb-linux-x86_64-3.0.6.tgz
Put the unpacked installation package into the specified directory
MV mongodb-linux-x86_64-3.0.6//usr/local/mongodb
Add MongoDB executable file to Path
Export Path=/usr/local/mongodb/bin: $PATH
Create a folder to store data under the root directory
Mkdir-p/data/db
modifying environment variables
1. The CD to the root directory to execute the command
Vim ~/.bash_profile
2. Add Environment variables
Export path=${path}:/usr/local/mongodb/bin
: x Save
Source ~/.BASHRC Restart in effect
Start the database
Mongod
Connecting to a database
Mongo
MongoDB Background BootMongod-- Fork --logpath/usr/local/mongodb/logs --dbpath/data/db --fork will start mongod as a background service and must follow --logpath Specify the log file path, if the log file does not exist it will be automatically created -- storage directory for DBPath data
------------------------------
Linux Installation MongoDB