Mango db installation on window

  1. Open CMD (In Windows) or terminal (In Ubuntu).
  2. type command >cd PATH_FOR_MONGODB_BIN_FOLDER

    cd C:\Program Files\MongoDB\Server\3.2\bin

    for ubuntu command will be same :

    cd /home/MongoDB/Server/3.2/bin

  3. then type command >mongod –dbpath PATH_FOR_DATA_FOLDER

    mongod –dbpath C:\data\db

    For ubuntu command will be :

    ./mongod –dbpath /home/data/db

    you can specify any folder as data folder.

  4. Wait till CMD or Terminal shows “waiting for connections”

    2016-09-01T21:38:33.170+0530 I NETWORK [initandlisten] waiting for connections on port 27017

  5. Then open new CMD or terminal window.
  6. type command >cd PATH_FOR_MONGODB_BIN_FOLDER ( same as step 3 )

    cd C:\Program Files\MongoDB\Server\3.2\bin

    Don’t close previous window of cmd or teminal.

  7. then run mongodb by typing “mongo” in windows or “./mongo” in ubuntu

    mongo

    For ubuntu

    ./mongo

  8. After mongodb run successfully you can close previous CMD window.
shareimprove this answer

Advertisements