3

I installed MongoDB on ubuntu 11.04 followed by this site. I gave this command to run MongoDB

sudo /etc/init.d/mongodb start

It showed some error like this

sudo: /etc/init.d/mongodb: command not found

I checked the file.But it was okay.Can any one tell me how to solve this.

Please help me .I am newbie to mongoDB. [edited] When I am connecting to mongo it is showing error like

connecting to: test
Sun Jul  3 09:57:29 Error: couldn't connect to server 127.0.0.1 shell/mongo.js:79
1
  • What happens when you say 'which mongod'. If it cannot find it, then you missed the step to add the contents of $MONGO_INSTALLATION/bin into /bin like the author of the blog says. Also, I'd recommend using 10gen's instructions like the answer below. Jul 3, 2011 at 22:39

2 Answers 2

5

You may should try to run:

mongo --nodb

This worked for me.

0

Regarding to the connection error, you can try:

sudo -u mongodb mongod -f /etc/mongodb.conf --repair

This starts the daemon using the config file /etc/mongodb.conf and repair the database.

Then start the database:

sudo -u mongodb mongod -f /etc/mongodb.conf

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.