How to Install MongoDB on Ubuntu 16.04

Опубликовано: 07 Октябрь 2024
на канале: NixInPix
5,971
31

MongoDB is a free and open-source NoSQL document database used commonly in modern web applications. This tutorial will help you set up MongoDB on your server for a production application environment.

Commands:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
sudo echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
sudo apt-get update
sudo apt-get install -y --allow-unauthenticated mongodb-org
sudo nano /etc/systemd/system/mongodb.service
_________________
[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target

[Service]
User=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf

[Install]
WantedBy=multi-user.target
_________________________

sudo systemctl start mongodb
sudo systemctl status mongodb
sudo systemctl enable mongodb
mongo
use admin
db.createUser({user:"admin", pwd:"admin123", roles:[{role:"root", db:"admin"}]})
sudo systemctl restart mongodb
mongo -u admin -p admin123 --authenticationDatabase admin


----------------------

music by : soundcloud.com/jeff-kaale
instagram : instagram.com/jeffkaale


You can always Deploy an SSD cloud server in 55 seconds
with Digitalocean.
Anyone how use this link will receive $10 in hosting credit immediately after unlocking their account by adding a valid payment method.
Sign Up with this link
https://m.do.co/c/7b9082af029f