Running MongoDB for The First Time

In this post, i will share about how to run mongoDB for the first time. MongoDB is one of DBMS (Database Management System) that using No SQL for its concept. You can download mongoDB from http://www.mongodb.org/downloads. Make sure that you download appropriate version for your Operating System. To make this tutorial, I use Windows 8.1. Ok, let’s start the steps to make your mongoDB works:

  1. Install your mongoDB in your computer. Choose the installation folder that easy to type at command prompt. For my case, I install my mongoDB in C:\Program Files\MongoDB 2.6 Standard.
  2. Before we start mongoDB, make file that named with mongodb.config. This file will be used by us to choose the place where our data will be saved. Make sure that you have made a folder to write your data. In this file, type: dbpath=folder_location. For example, i type the source code dbpath=d:\mongodb\data.
  3. After step 2, run your command prompt and type: mongod –config where_mongodb.config_saved. If you can’t run this statement, make sure you have write mongoDB folder as environment variables in your operating system. For example:
    mongod –config “C:\Program Files\MongoDB 2.6 Standard\bin\mongodb.config”

    mongod statement

    Statement to Run MongoDB

    If you see picture above in your computer that mean your mongoDB have run.

  4. To type query and statement, you must open another command prompt screen and type: mongo. See the picture below:

    Command Prompt for mongo

    Statement to Type Query or Statement in MongoDB from Command Prompt

  5. For the first test, type: show dbs to show the databases in already exist in your mongoDB. Voila, your mongoDB is ready to serve you.

Leave a comment