Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have recently installed MongoDB server on Ubuntu. It was working and I use id from PHP too but, I don't know why it started failing. It's the first time I use mongodb so I am a bit lost.

Actually, when trying to access via PHP or via shell to mongo:

root@ubuntu:~# /etc/init.d/mongodb restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mongodb restart

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) and then start(8) utilities,
e.g. stop mongodb ; start mongodb. The restart(8) utility is also available.
mongodb start/running, process 7223

root@ubuntu:~# mongo
MongoDB shell version: 1.6.3
Wed Sep  7 10:20:35 *** warning: spider monkey build without utf8 support.  consider rebuilding with utf8 support
connecting to: test
Wed Sep  7 10:20:35 Error: couldn't connect to server (anon):1137
exception: connect failed

The first time I used the spider monkey error wasn't there. And it worked. I tried reinstalling and nothing.

How I can solve that?

Thank you in advance! Any info I can add let me know, please.

share|improve this question
up vote 1 down vote accepted

As it said, try this:

# start mongodb

Also take a look at Upstart - an event-based replacement for the SysV init.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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