Mongodb Docker Tutorial | Mongodb On Docker With Persistent Volume & Authentication | Thetips4you

Published: 27 June 2020
on channel: Thetips4you
10,223
119

#MongoDB, #Databases, #Docker Hello Friends, Welcome back to my channel. We are going to see how we can setup mongodb database as docker container.we will see the docker commands to start a mongodb container with persistent storage and setting admin user name and password using environmental variables. We will see how you can connect to the mongodb database from windows machine and will also see the basic commands to create databases and collections etc.

-------------------------------------------------------------------------------------------------------
How to setup docker in Centos:
   • DevOps | CI CD Pipeline | Setup Docke...  
-----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
Running MySQL on Docker:
   • MySQL Docker Tutorial | MySQL Docker ...  
---------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
download mongodb compass : https://www.mongodb.com/try/download/...

docker hub:
https://hub.docker.com/_/mongo
-------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------
Docker Commands:

docker run -d --name mongodb -p 27017:27017 -v mongo_data:/data/db mongo:latest

docker run -d --name mongodb -p 27017:27017 -e MONGO_INITDB_ROOT_USERNAME=mongoadmin -e MONGO_INITDB_ROOT_PASSWORD=secret -v mongo_data:/data/db mongo:latest

-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
docker exec -it mongdb /bin/bash

mongo
or
mongo -u mongoadmin -p secret --authenticationDatabase admin

show dbs
show databases

use mondodbdatabase
show collections
db.createCollection("collectionName");
db.collectionName.insert({firstname: "bob", lastname: "alan"})
db.collectionName.find()

----------------------------------------------------------------------------------------------------------
====================================================
Follow me @:
  / thetips4you  
  / thetipsforyou  
   / @thetips4you  
  / thetipsforyou  
http://www.thetips4you.com
=====================================================


Watch video Mongodb Docker Tutorial | Mongodb On Docker With Persistent Volume & Authentication | Thetips4you online without registration, duration hours minute second in high quality. This video was added by user Thetips4you 27 June 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 10,223 once and liked it 119 people.