Solutions to common MongoDB errors
After MongoDB was installed today, the service cannot be started this morning. The following error occurs:
Error:
Error 2: the specified file cannot be found.
Thinking process:
During the test yesterday, I installed MongoDB twice, and then I deleted (note not to uninstall) A MongoDB folder. is the default MongoDB installation address incorrect for this service?
View the Service Attributes. The Mongo address is the address that has been deleted, rather than the address currently used. The current address is: E: \ Program files \ mongodb \ bin
Solution:
First uninstall the original installation and then install the new one.
Mongo uninstall:
Uninstall: mongod.exe -- remove -- serviceName "MongoDB"
Install MongoDB as a service:
Installation: mongod.exe -- install -- logpath = "E: \ Program files \ mongodb \ data \ log \ log.txt" -- dbpath = "E: \ Program files \ mongodb \ data \ db"
After installation, refresh the service and change the address:
Restart the MongoDB service again. startup failed with error 1607.
Error:
Error cause: Unknown
Solution:
Delete the mongod. lock file in the E: \ Program files \ mongodb \ data \ db directory.
Restart the service again and start successfully.
Summary:
When you get in touch with a new thing, errors may inevitably occur. If a mistake comes, you can solve it. Don't hide and drag it.