I can\'t connect to MongoDB. In Ubuntu it works, but I\'m working in CentOS now. This is the error message:
MongoDB shell version: 2.4.2 connecting
You also get this error if you've changed the default port for mongoDB in /etc/mongo.conf
To connect via the shell in this case use:-
$mongo 127.0.0.1:your_new_port_number
OR
$mongo -u -p --host --port your_new_port_number
from MongoDB docs