简体   繁体   English

MongoDB 没有连接到服务器 127.0.0.1:27017 并显示目标机器主动拒绝它

[英]MongoDB isn't connecting to the server 127.0.0.1:27017 and showing target machine actively refused it

I run this command C:\Program Files\MongoDB\Server\4.2\bin\mongo.exe start my mongoDB but it is showing this error:我运行此命令C:\Program Files\MongoDB\Server\4.2\bin\mongo.exe start my mongoDB 但它显示此错误:

MongoDB shell version v4.2.5
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
2020-04-17T18:28:32.535+0530 E  QUERY    [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: No connection could be made because the target machine actively refused it. :
connect@src/mongo/shell/mongo.js:341:17
@(connect):2:6
2020-04-17T18:28:32.541+0530 F  -        [main] exception: connect failed
2020-04-17T18:28:32.541+0530 E  -        [main] exiting with code 1

My mongoDB compass isn't connecting too..我的 mongoDB 罗盘也没有连接..

mongo ( mongo.exe for windows users) does not start the server. mongomongo.exe用户的 mongo.exe)不启动服务器。 It is used to connect to a server which is already running.它用于连接到已经在运行的服务器。

You should run mongod in the command line before connecting to the server, it will initialite it.您应该在连接到服务器之前在命令行中运行mongod ,它将初始化它。 You can't connect to the server you haven't started无法连接到尚未启动的服务器

Try to comment out this last line mp at \bin\mongodb.cfg.尝试在 \bin\mongodb.cfg 中注释掉最后一行 mp。 becomes #mp: Restart mongod.变成#mp:重启mongod。

You can check whether your mongodb is running at the service (task Manager->Services ->Mongodb)..(Make sure you click Property to see all those setting)您可以检查您的 mongodb 是否在服务上运行(任务管理器->服务-> Mongodb)..(确保单击属性以查看所有这些设置)

Hope this helps.希望这可以帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Cassandra:目标机器主动拒绝 - Cassandra: target machine actively refused it Windows 8.1 MongoDB 27017错误:10061“无法建立连接,目标计算机主动拒绝连接” - Windows 8.1 MongoDB 27017 errno: 10061 “Connection couldnt be made Target machine actively refuses it” 在Windows 7上无法连接到服务器127.0.0.1:27017 - Couldn't connect to server 127.0.0.1:27017 on Windows 7 Postgresql:无法建立连接,因为目标机器主动拒绝它 - Postgresql: No connection could be made because the target machine actively refused it Python socket listening failed with error target machine actively refused 它 - Python socket listening failed with error target machine actively refused it 端口正在侦听,但“由于目标计算机主动拒绝,所以无法建立连接” - Port is listening but “No connection could be made because the target machine actively refused it ” 无法连接到服务器:拨打 tcp [::1]:8080: connectex: 由于目标机器主动拒绝,无法建立连接。 -Microk8s - Unable to connect to the server: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it. -Microk8s WinError 10061:无法建立连接,因为目标计算机主动拒绝了该连接[带Flask的InfluxDB] - WinError 10061: No connection could be made because the target machine actively refused it [InfluxDB with Flask] minikube窗口无服务“无法建立连接,因为目标计算机主动拒绝了它。” - No services for minikube windows “No connection could be made because the target machine actively refused it.” dial tcp [::1]:6397: connectex: 由于目标机器主动拒绝,无法建立连接 - dial tcp [::1]:6397: connectex: No connection could be made because the target machine actively refused it
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM