MongoDB in Ubuntu

 

Well, I was working on MongoDB, trying to get it installed on Ubuntu. I installed it using

sudo apt-get install mongodb

Well, then I typed mongo in console and it worked. Then came the thing. When I finished the work and started on the next day, it threw out an error as shown

MongoDB shell version: 2.0.4
connecting to: test
Tue Jul 31 18:38:57 Error: couldn't connect to server 127.0.0.1 shell/mongo.js:84

God knows what it is. Well here is how you fix it. Type this in console

sudo mkdir -p /data/db/

 

sudo chown 'mongo' /data/db

Well, they say the first one creates a directory where mongo DB writes some stuff to manage itself. the second one gives the permission to user named mongo (thats MongoDB) to have write and read permission to the directory /data/db

Advertisements
  1. #1 by Karthikeyan A K on October 19, 2012 - 10:59 am

    this some how not seems to work now 😦

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: