简体   繁体   English

MongooseServerSelectionError:连接 ECONNREFUSED 127.0.0.1:27017。 我已经尝试过 StackOverflow 中给出的所有解决方案,但它不起作用

[英]MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017. I have tried all solutions given in the StackOverflow, but its not working

    at NativeConnection.Connection.openUri (/mnt/d/Ecommerce/node_modules/mongoose/lib/connection.js:802:32)
    at /mnt/d/Ecommerce/node_modules/mongoose/lib/index.js:341:10        
    at /mnt/d/Ecommerce/node_modules/mongoose/lib/helpers/promiseOrCallback.js:32:5
    at new Promise (<anonymous>)
    at promiseOrCallback (/mnt/d/Ecommerce/node_modules/mongoose/lib/helpers/promiseOrCallback.js:31:10)
    at Mongoose._promiseOrCallback (/mnt/d/Ecommerce/node_modules/mongoose/lib/index.js:1141:10)
    at Mongoose.connect (/mnt/d/Ecommerce/node_modules/mongoose/lib/index.js:340:20)
    at connectDatabase (/mnt/d/Ecommerce/backend/config/database.js:4:14)
    at Object.<anonymous> (/mnt/d/Ecommerce/backend/server.js:11:1)      
    at Module._compile (internal/modules/cjs/loader.js:1085:14) {        
  reason: TopologyDescription {
    type: 'Unknown',
    servers: Map(1) { '127.0.0.1:27017' => [ServerDescription] },        
    stale: false,
    compatible: true,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    logicalSessionTimeoutMinutes: undefined
  }
}

I have used 'mongod' also.我也用过'mongod'。
I have created a folder also in my C:\data\db我还在 C:\data\db 中创建了一个文件夹
used 127.0.0.1 also, instead of localhost也使用了 127.0.0.1,而不是 localhost

I don't know why this error is still there, after trying so many solution.在尝试了这么多解决方案之后,我不知道为什么这个错误仍然存在。 How can I resolve it?我该如何解决?

I am running this on Windows and my task manager had stopped this service and it was not starting automatically.我在 Windows 上运行它,我的任务管理器已经停止了这个服务,它没有自动启动。 That's why it was not running.这就是它没有运行的原因。

If you also got the same error just check by:如果您也遇到同样的错误,请通过以下方式检查:

  1. Type "services" in Windows search bar在 Windows 搜索栏中输入“服务”
  2. Open it and scroll upto the mongoDB service打开它并向上滚动到 mongoDB 服务
  3. Start/restart it manually if its stopped.如果停止,则手动启动/重新启动它。

供参考

暂无
暂无

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

相关问题 MongooseServerSelectionError:连接 ECONNREFUSED 127.0.0.1:27017 - MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017 MongooseServerSelectionError:连接 ECONNREFUSED::1:27017 - MongooseServerSelectionError: connect ECONNREFUSED ::1:27017 在 Docker Compose 中获取“MongooseServerSelectionError:连接 ECONNREFUSED 127.0.0.1:27017” - Getting "MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017" in Docker Compose (节点:16686)UnhandledPromiseRejectionWarning:MongooseServerSelectionError:连接 ECONNREFUSED 127.0.0.1:27017 - (node:16686) UnhandledPromiseRejectionWarning: MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017 MongooseServerSelectionError:连接 ECONNREFUSED::1:27017 不会得到修复 - MongooseServerSelectionError: connect ECONNREFUSED ::1:27017 wont get fixed 节点app.js返回错误:连接ECONNREFUSED 127.0.0.1:27017 - Node app.js returns Error: connect ECONNREFUSED 127.0.0.1:27017 MongooseServerSelectionError:连接 ETIMEDOUT 13.250.154.115:27017 - MongooseServerSelectionError: connect ETIMEDOUT 13.250.154.115:27017 我第一次创建了spring maven项目css,js,图片没有加载我试过这里给出的所有解决方案仍然没有工作 - I have create spring maven project for the first time css,js,images are not loading i have tried all solutions given here still not working [SequelizeConnectionRefusedError]:连接ECONNREFUSED 127.0.0.1:3306 - [SequelizeConnectionRefusedError]: connect ECONNREFUSED 127.0.0.1:3306 AxiosError: 连接 ECONNREFUSED 127.0.0.1:80 - AxiosError: connect ECONNREFUSED 127.0.0.1:80
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM