简体   繁体   English

MongooseServerSelectionError:在 windows 7 中连接 ECONNREFUSED 127.0.0.1:27017

[英]MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017 in windows 7

I am working with MongoDB with the Nodejs.我正在使用 Nodejs 与 MongoDB 合作。 I have following index.js file,我有以下 index.js 文件,

const express= require('express');
const mongoose= require('mongoose');

const app= express();

const port=3000;
mongoose.connect('mongodb://127.0.0.1:27017/ThogaKade',{
    useNewUrlParser:true,
    useUnifiedTopology:true,
    useFindAndModify:false,
    useCreateIndex:true
}).then(()=>{
    app.listen(port,()=>{
        console.log(`Server Start on Port ${port}`)
    })
}).catch(error=>{
    console.log(error);
})

but when I execute nodemon command it is en counting following error message here但是当我执行nodemon命令时,它会在此处计算以下错误消息

MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017

how could I fix this problem?我该如何解决这个问题?

In this way, you are authenticating on database admin and using database ThogaKade for connection.通过这种方式,您在数据库admin上进行身份验证并使用数据库ThogaKade进行连接。

See https://docs.mongodb.com/manual/tutorial/manage-users-and-roles/ too参见https://docs.mongodb.com/manual/tutorial/manage-users-and-roles/

暂无
暂无

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

相关问题 MongooseServerSelectionError:连接 ECONNREFUSED 127.0.0.1:27017 - MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017 UnhandledPromiseRejectionWarning:MongooseServerSelectionError:连接 ECONNREFUSED 127.0.0.1:27017 - UnhandledPromiseRejectionWarning: 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 连接 ECONNREFUSED 127.0.0.1:27017' - connect ECONNREFUSED 127.0.0.1:27017' 我已经开始在 Stack 应用程序中使用 Docker,但出现此错误 .MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017 - I have starting using Docker with Stack application and I'm getting this error .MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017 在 Mongodb 中连接 ECONNREFUSED 127.0.0.1:27017 - Connect ECONNREFUSED 127.0.0.1:27017 in Mongodb MongoError:连接 ECONNREFUSED 127.0.0.1:27017 - MongoError: connect ECONNREFUSED 127.0.0.1:27017 Mongoose NodeJS macOS Big Sur MongooseServerSelectionError:连接 ECONNREFUSED::1:27017 - Mongoose NodeJS macOS Big Sur MongooseServerSelectionError: connect ECONNREFUSED ::1:27017 MongooseServerSelectionError: connect ECONNREFUSED ::1:27017 in node v17 and mongo is running - MongooseServerSelectionError: connect ECONNREFUSED ::1:27017 in node v17 and mongo is running
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM