Mongo Db installation Guide:
1. Go to the URL : https://www.mongodb.com/download-center/community/releases/archive
2. Select software a sepecific version & for specific OS e.g: Windows selected below:
1. D:/Mongo/Data - for data files2. D:/Mongo/Log - for log files3. D:/Mongo/Config - for configuration files
6. Create a configuration file [mongod.conf] into Config[D:/Mongo/Config] and paste the below content into the file and save it:
storage:
dbPath: "C:/Mongo/Data"
systemLog:
destination: file
path: "C:/Mongo/Log/mongod.log"
Note:
it must be in YAML format that is 3 space from left end.
Icacls d:\mongo /grant Avinash:(OI)(CI)F
8. Now, install mongo db as service on windows server , using command:
mongod --install --config d:\mongo\config\mongod.conf --serviceUser Avinash --servicePassword ************
9. Now, we will verify whether it is installed or not.
sc qc mongodb
net start mongodb
use test_dev_db
12. Provide permission to the a specific user using the following commmand:
db.createUser(
{
user: "avinashthakur",
pwd: "Bangalore#12345",
roles: [
{ role: "readWrite", db: "test_dev_db" },
{ role: "readWrite", db: "test" },
{ role: "readWrite", db: "admin" }
]
}
)
13. It is ready to use. You may follow my other article for CRUD operation in Mongodb
Great Article, very helpful .
ReplyDelete