Beginning MongoDB

Coming at MongoDB from a RDMS perspective (and specifically MySQL), things feel a little strange. Just sharing a few paragraphs on how I got started.


Installing MongoDB was easy following their instructions and using the 10gen repo for CentOS. After installation the mongo client can be used to access the server without any authentication i.e.

After connecting the following commands can be used to have a look around:

Creating a Root User

I then created a root user with:

Creating a Database and User Account

After creating the root user, it is no longer possible to use the mongo command to connect to the server without authentication, so connect as root with the following:

Then create a database and user:

The database is not actually created until something is written to it (in this case a user).

Connect as the New User

I should now be able to access the MongoDB database from another host as follows:

Export Data from Existing Database

The following command exported data in JSON format from an existing Mongo database:


Import Data

I could then import a JSON data file using the following:


Graphical Interfaces

If you want a GUI interface I have tried RoboMongo and MongoChef


Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">