Mongodb connection refused 127.0.0.1:27017 error solved | mongoose connect error running npm start
ฝัง
- เผยแพร่เมื่อ 7 ก.พ. 2025
- fixed with 3 possible solutions :
Mongodb Error : couldn't connect to server 127.0.0.1:27017, connection attempt failed : solved in less than 2 minutes
change to 0.0.0.0
MongooseSeverSelectError:connect ECONNREFUSED 127.0.0.1:27017
connect ECONNREFUSED 127 0 0 127017 Resolved this error in mongo Db in English
Download mongodb :
www.mongodb.co...
Watch how to connect your mern app with mongodb :
• How to connect your ME...
✔Connect with CodingBot
[ TH-cam ]
/ @baratkibaat
Make sure to subscribe !
Thank you for tuning on.
©codingbot_2021
.all rights reserved by FROYO CHANNEL NETWORK
#npm #mern #mernstack #mongodb #programming #edureka #codingbot #mongodberror #react #webdevelopment #express #nodejs #cleverprogrammer #programmingtutorials #froyo #webapp #webdeveloper
Watch this playlist .Your problems will be solved , sure👇th-cam.com/play/PL2Iudrib2UqBMfWubK0zavAh_Hr9e6i8H.html
Subscribe to the channel it means a lot ❤️
thank you so much bro from the last two days i was stuck in this . Now i connected by third method😃😃😃🤩
Great ❤️
Thank you for this video. I can't begin to tell you how much I've been struggling with connection errors. You just earned a new subscriber! Thank you
Thanks for the comment 🤩
thank yooooooooou, I spent 3 hours of trying to solve this issue
🤩🤩🤩
You're clear and concise with solutions. Please keep it up, you are a life saver ! 😅😅
Thank you soo much for this helpful tutorial. The last one worked for me
😍😍💪
subscribed! Thank you for the help. It actually worked when i changed "localhost" into "0.0.0.0" . Thank you.
❤️❤️🤗
For providing this solution...now my MongoDB server is connected..... thanks again..🎉
😍❤️
Thank you so much. Keep it up the good work❤
🤩❤️
Thanks bud! I was trying to connect the db from last two days 🤝🤝
😍😍❤️
one of the best and quickest solution ever...thank you so much for sharing
🤩🤩❤️
Thank you so much! I expend hours and hours and it was something as silly as changing localhost to 0.0.0.0
🤩🤩🤩💟
in my case I'm having no mongoDB services in task manager and done the replacing 0.0.0.0, or 127.0.0.1:27017, or localhost and in my cmd nothing is getting which is related to the command mongo, then what to do, or what is missing from there, kindly help in this case ...
Try uninstall and reinstalling matched with your OS bit version
Thanks for sharing. But the problem still persists even after doing that?
Try reinstalling mongodb according to the bit version of your system. Ex:- 64 bit or 32 bit. Or try upgrading the version
@@baratkibaat G:\Coding Acadamy\js\Advanced fun\MongoD
ode_modules\mongoose\lib\connection.js:791
err = new ServerSelectionError();
^
MongooseServerSelectionError: connect ECONNREFUSED ::1:27017
at _handleConnectionErrors (G:\Coding Acadamy\js\Advanced fun\MongoD
ode_modules\mongoose\lib\connection.js:791:11)
at NativeConnection.openUri (G:\Coding Acadamy\js\Advanced fun\MongoD
ode_modules\mongoose\lib\connection.js:766:11) {
reason: TopologyDescription {
type: 'Unknown',
servers: Map(1) {
'localhost:27017' => ServerDescription {
address: 'localhost:27017',
type: 'Unknown',
hosts: [],
passives: [],
arbiters: [],
tags: {},
minWireVersion: 0,
maxWireVersion: 0,
roundTripTime: -1,
lastUpdateTime: 1952326,
lastWriteDate: 0,
error: MongoNetworkError: connect ECONNREFUSED ::1:27017
at connectionFailureError (G:\Coding Acadamy\js\Advanced fun\MongoD
ode_modules\mongoose
ode_modules\mongodb\lib\cmap\
connect.js:370:20)
at Socket. (G:\Coding Acadamy\js\Advanced fun\MongoD
ode_modules\mongoose
ode_modules\mongodb\lib\cmap\conn
ect.js:293:22)
at Object.onceWrapper (node:events:628:26)
at Socket.emit (node:events:513:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
cause: Error: connect ECONNREFUSED ::1:27017
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) {
errno: -4078,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '::1',
port: 27017
},
[Symbol(errorLabels)]: Set(1) { 'ResetPool' }
},
topologyVersion: null,
setName: null,
setVersion: null,
electionId: null,
logicalSessionTimeoutMinutes: null,
primary: null,
me: null,
'$clusterTime': null
}
},
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: null,
maxElectionId: null,
maxSetVersion: null,
commonWireVersion: 0,
logicalSessionTimeoutMinutes: null
},
code: undefined
}
Node.js v18.16.0
Here is the message I am getting
@@soldour7597 how did u solve this?
Thank you so much! , last step did the trick.
Great 😍
Thanks ...it worked...I was stuck on this from last 2 hour
Nice ❤️😍
thanks, that was straightforward and it worked fine.
🤩❤️
Thank you Bhai! 2nd One worked for me!
🤩🤩
Option 3 worked for me,, thanks👏👏👏
🤩🤩
Thank you sir.. Change localhost to 0.0.0.0 worked out for me..
Can u explain the reason behind this? Is it a laptop problem.. Can u pls elaborate sir.
the localhost is just a name. The IP address assigned with that 'localhost' is 0.0.0.0 which means every web address has an unique ip address. Ex:- lets say google.com = 123.34.0.21 like this
@@baratkibaat So should I do something extra sir..do u recommend something extra for future coding...so prblm like this don't occur ever
You saved my life. Thank you so much 😅
😍😍
Many thanks bro 2nd method worked for me saved so much of my time😭😭
Nice 🤩
Thank you the 2nd method worked for me
🤩🤩
Dhanyawaad bhai❤
🤩🤩
Tnxs so much the last method worked for me.
Nice 🤩
The last option worked for me, Thanks
Great 😍
Muchas gracias, hermano!
🤩
While clicking on mongo db services it says that could not start MongoDB services (MongoDB) service on Local Computer. Error 1067: The process terminated unexpectedly.
Try uninstall and reinstall mongodb
Thank you very much, comrade.
🤩🤩
thank you so much i was frustated now i get connected successfully
😍😍
thank you so much last step worked
Great 🤩
thank u so much , the third solution comes for me
🤩🤩
Thanks so much man ❤️
❤️😍welcome
thank you so
much the third trick is working
Great 🤩
Thank you so much ❤
Welcome 😍❤️
bro thanks u are lifesaver
😌❤️
Thanks👍
🤩🤩
thank u brother
it helps me
🤩🤩
Thank you so much year!
🤩❤️
What if I'm hosting it on a host? How to solve it on host?
Which host?
Thanku so much 🙏
🤩🤩
Thnks my bro❤
🤩🤩
My error is solved, alhamdulillah 😊
🔥💪
Thank you so much bro
😍❤️
thank you really helpful
😍😍😍
Thanks bro.❤
🤩🤩
thank you soo much man
❤️😍
Thanks man.
❤️🤩
Thankyou sir 😊
❤️❤️❤️
Thaaaaaanks❤️❤️
😍❤️
Gracias :D
❤️❤️
thanks a lot brother
💟
thanks it work for me
❤️❤️😍
Thnx bro ❤
🤩🤩
thank you dear
🤩🤩🤩
Nice video helpfula
😍😍
you did hit with the solution
❤️❤️
Worked
Great ❤️
Thanks
😍❤️
thanks man
❤️😌
thansk
🤩
thanks
😍❤️
thanks u
❤️❤️😍
const MongoClient = require('mongodb').MongoClient;
const url = "mongodb://0.0.0.0:27017/";
MongoClient.connect(url, (err, client)=>{
if(err) throw err;
console.log("db connected");
})
plz help it is not running
Follow this video th-cam.com/video/SBKG7zzKxAA/w-d-xo.html
good
🤩🤩
Thank you so much
Thanks Bro!!
🤩🤩
Thanks
😍❤️
Thanks
❤️😍