How To Install MongoDB on Ubuntu

This blog is part of the course on how to create your own Cryptocurrency. This blog contains all the commands to install MongoDB on Ubuntu and create a database in MongoDB. If you want to understand the complete process of coin building, please go to this of How to create Cryptocurrency if you are not already enrolled. To Enroll directly on the course, please visit this link Create Own Cryptocurrency.

Command to install MongoDB on Ubuntu

sudo apt-get install mongodb

Commands to create a database in MongoDB

#to enter the mongo client use below command

#to use or create the database usbe below command. In below command ntmdb is #the name of the database

use ntmdb

Command to create username and password

#before you execute create user command , make sure you have selected the #right database using the use "database" command

db.createUser( { user: "myuser", pwd: "mypassword", roles: [ "readWrite" ] } )

#Replace myuser and mypassword with your actual values

About The Author