Net start MongoDB occurs system error 2 The system cannot find the file specified

Source: Internet
Author: User
Tags auth install mongodb

When you install MongoDB, use MongoDB as the system service to start the net start MongoDB, error occurs system errors 2 The system cannot find the file specified.

The reason for this is because the executable file address of the system service is incorrect. Modify the service address to restore!

Summarize how to install MongoDB as a system service under WinXP.

The following commands are used:

C:\Documents and Settings\administrator>mongod-dbpath C:\mongo\MongoDB\mongo\data--logpath=c:\mongo\mongodb\ Mongo\logs\mongodb.log--auth--install
All output Going To:c:\mongo\mongodb\mongo\logs\mongodb.log

However, you cannot connect:

C:\Documents and Settings\administrator>mongo

MongoDB Shell version:2.0.1
Connecting To:test
Tue 18:07:50 error:couldn ' t connect to server 127.0.0.1 Shell/mongo.js:8
4
Exception:connect failed

Looking at the log, you also need to use the net start MongoDB command to start the service, the log is as follows:

Creating service MongoDB.
Service creation successful.
Service can is started from the command line via ' net start ' MongoDB '.
Tue 18:06:43 dbexit:
Tue 18:06:43 shutdown:going to close listening sockets ...
Tue 18:06:43 shutdown:going to flush Diaglog ...
Tue 18:06:43 shutdown:going to close sockets ...
Tue 18:06:43 shutdown:waiting for FS preallocator ...
Tue 18:06:43 shutdown:closing All Files ...
Tue may 18:06:43 Closeallfiles () finished
Tue 18:06:43 dbexit:really exiting now

Follow the prompts to run net start MongoDB under cmd

net start "MongoDB"
C:\Documents and Settings\administrator>net start MongoDB

System error 2 has occurred.

The system cannot find the file specified.

Check out the services you just installed via the Control Panel – Management tools – service:

Somehow the path to the Mongod command becomes C:\Documents and settings\administrator\ as follows:


"C:\Documents and Settings\administrator\mongod"-dbpath C:\mongo\MongoDB\mongo\data--logpath=c:\mongo\mongodb\ Mongo\logs\mongodb.log--auth--service

Specify the path of the Mongod and reinstall:


C:\mongo\mongodb\mongo\bin>c:\mongo\mongodb\mongo\bin\mongod-dbpath C:\mongo\MongoDB\mongo\data--logpath=c:\ Mongo\mongodb\mongo\logs\mongodb.log--auth--install

All output Going To:c:\mongo\mongodb\mongo\logs\mongodb.log

Net start MongoDB occurs system error 2 The system cannot find the file specified

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.