Download (here I downloaded to the desktop):
wang@wang-B5400:~/Desktop$ wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-3.4.1.tgz
Extract: tar zxvf mongodb-linux-x86_64-ubuntu1604-3.4. 1. Rename tgz
: mv mongodb-linux-x86_64-ubuntu1604-3.4.1 mongodb
starts ----> here I recommend method 2
(method 1: first build data/db under mongodb) wang@wang-B5400:~/ Desktop/mongodb/bin$ mongod --dbpath=/home/wang/desktop/mongodb/data/db
(method 2: use the specified configuration file, create a new file data/db, log, etc or conf (any name))
conf /mongodb.conf start configuration file code
#port
port=27017 #Data
storage directory, you can use relative and absolute paths (relative paths are used here)
dbpath =data #Specify the
log file path, you need to specify the actual file
logpath = log /mongod.log #Under
linux, it indicates that the startup is in the background, and it runs under bin after invalid
fork=true under windows
mongod --dbpath=/home/wang/desktop/mongodb/data/db/ --port=27017 --fork --logpath=/home/wang/desktop/mongodb/log/mongodb.log
Uninstall mongodb:
1.
This Will remove just the mongodb package itself.
sudo apt-get remove mongodb
2.
Uninstall mongodb and its dependencies.
This will remove the mongodb package and its dependencies
sudo apt-get remove --auto-remove mongodb
3.
Clear your config data
if you also want to remove your local/config file for mongodb
sudo apt-get purge mongodb
or
sudo apt-get purge --auto-remove mongodb