Using SSH I installed Mongodb in linux server by the following steps.
Download and extract latest Mongodb release to the
/bin
folder in sererEdit the
.bash_profile
and addPATH=$PATH:$HOME/bin/mongodb-linux-x86_64-2.6.0/bin
export PATH
Directory created for db saving using
mkdir -p /data/db
- Run
mongod --dbpath /data/db
- Run
mongo
After running mongo command, it shows the error like this :
MongoDB shell version: 2.6.0
connecting to: test
2014-04-24T10:07:58.831+0530 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2014-04-24T10:07:58.832+0530 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
exception: connect failed
How it can solve?
See Question&Answers more detail:os