MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017

You're definitely familiar with the best coding language Javascript that developers use to develop their projects and they get all their queries like "connect econnrefused 127.0.0.1:27017" answered properly. Developers are finding an appropriate answer about connect econnrefused 127.0.0.1:27017 related to the Javascript coding language. By visiting this online portal developers get answers concerning Javascript codes question like connect econnrefused 127.0.0.1:27017. Enter your desired code related query in the search bar and get every piece of information about Javascript code related question on connect econnrefused 127.0.0.1:27017. 

MongoServerSelectionError: connect ECONNREFUSED ::1:27017

on Jan 01, 1970
// instead of this
const url = "mongodb://localhost:27017";

// Just Replace
const url = "mongodb://0.0.0.0:27017";

Add Comment

0

MongooseServerSelectionError: connect ECONNREFUSED ::1:27017

on Jan 01, 1970
// Try using 127.0.0.1 instead of localhost in connection url
// mongodb://localhost:27017
// mongodb://127.0.0.1:27017

const mongoose = require('mongoose');

mongoose.connect('mongodb://127.0.0.1:27017').then(() => {
    console.log("connected to database");
})

Add Comment

0

(node:15855) UnhandledPromiseRejectionWarning: MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017

on Jan 01, 1970
mongodb://localhost:27017/{DATABASE_NAME}

Add Comment

0

MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017

on Jan 01, 1970
This happened probably because the MongoDB service isn't started. Follow the below steps to start it:

Go to Control Panel and click on Administrative Tools.
Double click on Services. A new window opens up.
Search MongoDB.exe. Right click on it and select Start.
The server will start. Now execute npm start again and the code might work this time.

Add Comment

0

All those coders who are working on the Javascript based application and are stuck on connect econnrefused 127.0.0.1:27017 can get a collection of related answers to their query. Programmers need to enter their query on connect econnrefused 127.0.0.1:27017 related to Javascript code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about connect econnrefused 127.0.0.1:27017 for the programmers working on Javascript code while coding their module. Coders are also allowed to rectify already present answers of connect econnrefused 127.0.0.1:27017 while working on the Javascript language code. Developers can add up suggestions if they deem fit any other answer relating to "connect econnrefused 127.0.0.1:27017". Visit this developer's friendly online web community, CodeProZone, and get your queries like connect econnrefused 127.0.0.1:27017 resolved professionally and stay updated to the latest Javascript updates. 

Javascript answers related to "connect econnrefused 127.0.0.1:27017"

View All Javascript queries

Javascript queries related to "connect econnrefused 127.0.0.1:27017"

Browse Other Code Languages

CodeProZone