Original: http://blog.csdn.net/congcong68/article/details/46764815
A Brief introduction
We introduced MongoDB introduction (Installation and configuration), today when we open mongdb, we first run Cmd.exe into the DOS command interface, and then into the CD D:\mongodb\bin directory, start the service or MONGO command all reported errors.
Two Solve
1.net Stop mongdb Start Service: System error 5
Solve:
When running Cmd.exe into the DOS command interface, and then into the Cdd:\mongodb\bin directory, run Cmd.exe before you need to run as administrator, permissions are relatively high. Then tap Start service net start Mongdb
2.mongo command appears: The target computer is actively rejecting the inability to connect
Analysis:
net start Mongdb Runtime, the prompt service starts normally, but when the MONGO command is knocked out, the problem arises because MongoDB has not started MongoDB and we are connected to MongoDB, which is definitely a link failure.
Solve:
Removed the data/ Mongod.lock file, non-secure shutdown, needs to be removed, cause Mongod.lock file is a lock file created on the hard disk after the MongoDB server is started, and if it shuts down properly, it will affect the next boot Mongod service, locate the previously MongoDB unpacked disk and configure the storage log and data directory, such as my extracted directory D:\mongodb, is configured with the Data directory is D:\mongodb\data delete mongod.lock file under this file
Then the start service knocks the MONGO command to run normally
Description
If you exit the Mongod service normally, the file will not affect the next time the Mongod service is started, Mongod.lock size is 0 bytes, even if it exists.
Learn MongoDB Three: A workaround that MongoDB cannot start