This article is a mirror article of machine translation, please click here to jump to the original article.

View: 8629|Reply: 1

Failed to connect to x, reason: errno:10061 Unable to connect due to active rejection by the target computer.

[Copy link]
Posted on 10/8/2016 10:11:48 AM | | | |
2016-10-08T09:51:44.425+0800 I CONTROL  [main] Trying to install Windows service 'mongotest'
2016-10-08T09:51:44.427+0800 I CONTROL [main] Error connecting to the Service Control Manager: Access denied. (5)

Mongo running error: Failed to connect 127.0.0.1:27017, reason:errno:10061
Mongo running error: Failed to connect 127.0.0.1:27017, reason:errno:10061 Unable to connect due to active rejection of the target computer

Solution 1:

The reason is that the mongodb service is not turned on, and the problem can be solved after opening the service.
mongod.exe --dbpath "C:\Databases\mongo\db"





Solution 2:

Install the MongoDB service
mongod.exe --bind_ip 127.0.0.1 --logpath "C:\Databases\mongo\logs\mongodb.log" --logappend --dbpath "C:\Databases\mongo\db" --port 27017 --serviceName "mongotest" -- serviceDisplayName "mongotestDisplay" --install

net start mongotest




parameterdescription
--bind_ipIf you bind a service IP address, if you bind 127.0.0.1, you can only access it locally, and do not specify all local IP addresses by default
--logpathSpecify the MongoDB log file, and note that the file is not a directory
--logappendWrite the log using an appendix
--dbpathSpecify the database path
--portSpecify the service port number, the default port is 27017
--serviceNameSpecify the name of the service
--serviceDisplayNameSpecify the service name and execute when there are multiple mongodb services.
--installSpecify to install as a Windows service.



Note: The above commands must be run as an administrator!!!




Previous:nginx blocks spider crawler access
Next:Mongodb implements simple addition, deletion, and query statements
Posted on 10/8/2016 11:17:37 AM |
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com