Saturday, 21 January 2017

MongoDB Session 1 : Installing MongoDB For Windows 7

1. Download mongodb for win7 from MongoDB official website
    https://www.mongodb.com/


2. Install downloaded .exe file by double clicking. 
         This is as simple as any .exe installation . Just remember in which drive you are installing
3. Check installed directory




4.Create  "data/db" empty folder in same drive where you installed Mongo. In my case its C:
         i.e "C:/data/db".
         
  • Reason: MongoDB stores temp,DB related files in this folder. It will throgh error message if it dint find these folders.
  • Temp/DB Files? :  Yes! it stores some mongoDB related files. For ex : if I create "Student DB" and in that I create some collections. Then two files will be generated in                   "C:/data/db" . i.e student.0 and student.ns.
  • Comparing RDBMS terminology with NoSQL DB/Unstructured DB (MongoDB).
         Data Base                 : Data Base. 
         Tables                      : Collections.
         Rows & Columns     : Documents/Records.
 
5. Run MongoDB server 
         You have to start MongoDB server before performing any DB operation. This is same as any              other relational DB . That is if you are using Oracle DB , then Oracle DB must be running                  then you can connect to it by using terminal (SQL+) or any sql editior (SQL Developer).
  • Open new command prompt : Type "cmd" in Run prompt.
  • change path to installed directory . i.e "cd C:\Program Files\MongoDB 2.6 Standard\bin".
  • type "mongodb" and press enter
        
        Once you see the control stops displaying any logger and without any error message it means MongoDB is started.
Note : Dont close this window. If you close then server will stops running.

6. Opening MongoDB prompt/Shell to perform DB operation
  • Open new command prompt : Type "cmd" in Run prompt.
  • change path to installed directory . i.e "cd C:\Program Files\MongoDB 2.6 Standard\bin".
  • type "mongo" and press enter

Thats All..! You are done with instalation and opening Mongo Shell.


No comments:

Post a Comment