Note: This solution to this problem is premised on the previous open MongoDB, once again use the time can not connect (using Mongod and MONGO are not correct)
Gossip: It's annoying to have this kind of problem, so say Sun's beach, okay ~ cool
Business:
The errors you may encounter are as follows:
MongoDB Shell version:2.4.9
Connecting To:test
Mon Mar 3 23:45:09.491 error:couldn ' t connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145
Exception:connect failed
The cause of the problem is that the last time it did not shut down properly, and the last time it did not shut down MONGO, causing the file to hold the data is occupied and locked.
The solution is also very simple, but it is not my own idea, is found on the Internet solution:
Simply remove the Mongod.lock file from the/data (database directory).
mongodb resolves an error that cannot connect to the server