error:
rico@ubuntu:~$ mongo
MongoDB shell version: 3.2.17
connecting to: test
2017-11-16T23:48:59.362+0800 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: errno:111 Connection refused
2017-11-16T23:48:59.362+0800 E QUERY [thread1] Error: couldn’t connect to server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:229:14
@(connect):1:6
exception: connect failed
Solution:
sudo rm /var/lib/mongodb/mongod.lock
sudo mongod --repair --dbpath /var/lib/mongodb
sudo mongod --fork --logpath /var/lib/mongodb/mongodb.log --dbpath /var/lib/mongodb
sudo service mongodb start
Similar Posts:
- [Solved] MongoDB Start ERROR: child process failed, exited with error number
- MongoDB Startup Error: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
- [Solved] Mongodb startup error: about to fork child process, waiting until server is ready for connections.
- How to Solve MongoDB Error: Authentication failed.
- Mongodb Cannot Start: child process failed, exited with error number 100
- Unable to start mongod after installing mongodb in Ubuntu
- Raspberry pie: How to Solve Mongodb installation error
- MongoDB:Unclean shutdown detected
- Error reported when Java connects mongodb com.mongodb.mongosocketopenexception: exception opening socket has been solved
- Mongovue is unable to create collections and log in with user name and password