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

ความคิดเห็น • 140

  • @baratkibaat
    @baratkibaat  ปีที่แล้ว +6

    Watch this playlist .Your problems will be solved , sure👇th-cam.com/play/PL2Iudrib2UqBMfWubK0zavAh_Hr9e6i8H.html
    Subscribe to the channel it means a lot ❤️

  • @aashishrana6882
    @aashishrana6882 ปีที่แล้ว +6

    thank you so much bro from the last two days i was stuck in this . Now i connected by third method😃😃😃🤩

  • @bhabhaseptember9467
    @bhabhaseptember9467 8 หลายเดือนก่อน

    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

    • @baratkibaat
      @baratkibaat  8 หลายเดือนก่อน

      Thanks for the comment 🤩

  • @amrmashaal834
    @amrmashaal834 ปีที่แล้ว +1

    thank yooooooooou, I spent 3 hours of trying to solve this issue

  • @bhabhaseptember9467
    @bhabhaseptember9467 8 หลายเดือนก่อน

    You're clear and concise with solutions. Please keep it up, you are a life saver ! 😅😅

  • @LifeEssentials22
    @LifeEssentials22 11 หลายเดือนก่อน +1

    Thank you soo much for this helpful tutorial. The last one worked for me

    • @baratkibaat
      @baratkibaat  11 หลายเดือนก่อน

      😍😍💪

  • @virtualrealitymessenger
    @virtualrealitymessenger 9 หลายเดือนก่อน +1

    subscribed! Thank you for the help. It actually worked when i changed "localhost" into "0.0.0.0" . Thank you.

    • @baratkibaat
      @baratkibaat  9 หลายเดือนก่อน

      ❤️❤️🤗

  • @SURENDRASPORTS
    @SURENDRASPORTS 9 หลายเดือนก่อน

    For providing this solution...now my MongoDB server is connected..... thanks again..🎉

    • @baratkibaat
      @baratkibaat  9 หลายเดือนก่อน

      😍❤️

  • @dasunbro17
    @dasunbro17 ปีที่แล้ว +1

    Thank you so much. Keep it up the good work❤

  • @arshadsyed033
    @arshadsyed033 10 หลายเดือนก่อน

    Thanks bud! I was trying to connect the db from last two days 🤝🤝

    • @baratkibaat
      @baratkibaat  10 หลายเดือนก่อน

      😍😍❤️

  • @zahraba398
    @zahraba398 ปีที่แล้ว

    one of the best and quickest solution ever...thank you so much for sharing

  • @airtonvicenteklauck688
    @airtonvicenteklauck688 ปีที่แล้ว

    Thank you so much! I expend hours and hours and it was something as silly as changing localhost to 0.0.0.0

  • @benugopalshankerkulshresth4508
    @benugopalshankerkulshresth4508 8 หลายเดือนก่อน

    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 ...

    • @baratkibaat
      @baratkibaat  8 หลายเดือนก่อน

      Try uninstall and reinstalling matched with your OS bit version

  • @soldour7597
    @soldour7597 ปีที่แล้ว +1

    Thanks for sharing. But the problem still persists even after doing that?

    • @baratkibaat
      @baratkibaat  ปีที่แล้ว

      Try reinstalling mongodb according to the bit version of your system. Ex:- 64 bit or 32 bit. Or try upgrading the version

    • @soldour7597
      @soldour7597 ปีที่แล้ว

      @@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

    • @soldour7597
      @soldour7597 ปีที่แล้ว

      Here is the message I am getting

    • @harshitasoni4565
      @harshitasoni4565 ปีที่แล้ว

      @@soldour7597 how did u solve this?

  • @dougcontreras2665
    @dougcontreras2665 ปีที่แล้ว

    Thank you so much! , last step did the trick.

  • @asfaquekhan6614
    @asfaquekhan6614 ปีที่แล้ว

    Thanks ...it worked...I was stuck on this from last 2 hour

  • @adnan19672000
    @adnan19672000 ปีที่แล้ว

    thanks, that was straightforward and it worked fine.

  • @nightking122
    @nightking122 6 หลายเดือนก่อน

    Thank you Bhai! 2nd One worked for me!

    • @baratkibaat
      @baratkibaat  6 หลายเดือนก่อน

      🤩🤩

  • @philipa2406
    @philipa2406 6 หลายเดือนก่อน

    Option 3 worked for me,, thanks👏👏👏

    • @baratkibaat
      @baratkibaat  6 หลายเดือนก่อน

      🤩🤩

  • @sanketlalla
    @sanketlalla ปีที่แล้ว

    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.

    • @baratkibaat
      @baratkibaat  ปีที่แล้ว

      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

    • @sanketlalla
      @sanketlalla ปีที่แล้ว

      @@baratkibaat So should I do something extra sir..do u recommend something extra for future coding...so prblm like this don't occur ever

  • @NICOLEEUNICEURUCHIMAVEGA
    @NICOLEEUNICEURUCHIMAVEGA ปีที่แล้ว

    You saved my life. Thank you so much 😅

  • @nitinreddykamsani2523
    @nitinreddykamsani2523 5 หลายเดือนก่อน

    Many thanks bro 2nd method worked for me saved so much of my time😭😭

    • @baratkibaat
      @baratkibaat  5 หลายเดือนก่อน

      Nice 🤩

  • @HabtamuSemagn-l2u
    @HabtamuSemagn-l2u 21 วันที่ผ่านมา

    Thank you the 2nd method worked for me

  • @Brofact-e9f
    @Brofact-e9f 23 วันที่ผ่านมา

    Dhanyawaad bhai❤

  • @endoumamure
    @endoumamure 6 หลายเดือนก่อน

    Tnxs so much the last method worked for me.

    • @baratkibaat
      @baratkibaat  6 หลายเดือนก่อน

      Nice 🤩

  • @calebopule2490
    @calebopule2490 ปีที่แล้ว

    The last option worked for me, Thanks

  • @carlosnavarrorodriguez1443
    @carlosnavarrorodriguez1443 6 หลายเดือนก่อน +1

    Muchas gracias, hermano!

  • @Nitish_2938
    @Nitish_2938 ปีที่แล้ว

    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.

    • @baratkibaat
      @baratkibaat  ปีที่แล้ว

      Try uninstall and reinstall mongodb

  • @samuelbucher5189
    @samuelbucher5189 ปีที่แล้ว

    Thank you very much, comrade.

  • @IT_SE_26_Suraj_Mahto
    @IT_SE_26_Suraj_Mahto ปีที่แล้ว +1

    thank you so much i was frustated now i get connected successfully

  • @maou_raizen
    @maou_raizen ปีที่แล้ว

    thank you so much last step worked

  • @aflihatem3356
    @aflihatem3356 8 หลายเดือนก่อน

    thank u so much , the third solution comes for me

    • @baratkibaat
      @baratkibaat  8 หลายเดือนก่อน

      🤩🤩

  • @dawinz2124
    @dawinz2124 ปีที่แล้ว

    Thanks so much man ❤️

  • @creeetive
    @creeetive ปีที่แล้ว

    thank you so
    much the third trick is working

  • @mohdshoebkhan1896
    @mohdshoebkhan1896 ปีที่แล้ว

    Thank you so much ❤

  • @SHINJAGIRAArnold
    @SHINJAGIRAArnold ปีที่แล้ว

    bro thanks u are lifesaver

  • @serpilozguven8133
    @serpilozguven8133 7 หลายเดือนก่อน +1

    Thanks👍

    • @baratkibaat
      @baratkibaat  7 หลายเดือนก่อน

      🤩🤩

  • @SandeepKumar-ww2ku
    @SandeepKumar-ww2ku หลายเดือนก่อน

    thank u brother
    it helps me

  • @developer.rubelhossain
    @developer.rubelhossain ปีที่แล้ว

    Thank you so much year!

  • @hellowr233
    @hellowr233 ปีที่แล้ว

    What if I'm hosting it on a host? How to solve it on host?

  • @39_palakved23
    @39_palakved23 ปีที่แล้ว

    Thanku so much 🙏

  • @a3sgamer375
    @a3sgamer375 ปีที่แล้ว

    Thnks my bro❤

  • @mdfaizulmohammed1845
    @mdfaizulmohammed1845 10 หลายเดือนก่อน

    My error is solved, alhamdulillah 😊

    • @baratkibaat
      @baratkibaat  10 หลายเดือนก่อน +1

      🔥💪

  • @subhankarsahoo1316
    @subhankarsahoo1316 ปีที่แล้ว

    Thank you so much bro

  • @h3nggg
    @h3nggg 8 หลายเดือนก่อน

    thank you really helpful

    • @baratkibaat
      @baratkibaat  8 หลายเดือนก่อน

      😍😍😍

  • @deepakukkoji8479
    @deepakukkoji8479 7 หลายเดือนก่อน

    Thanks bro.❤

    • @baratkibaat
      @baratkibaat  7 หลายเดือนก่อน +1

      🤩🤩

  • @rykdee24
    @rykdee24 ปีที่แล้ว

    thank you soo much man

  • @wakhiwemathuthu
    @wakhiwemathuthu ปีที่แล้ว

    Thanks man.

  • @nishamehta6700
    @nishamehta6700 ปีที่แล้ว

    Thankyou sir 😊

  • @mohammadmalek5042
    @mohammadmalek5042 ปีที่แล้ว

    Thaaaaaanks❤️❤️

  • @camiloestrada3677
    @camiloestrada3677 ปีที่แล้ว +1

    Gracias :D

  • @sanskariguru4463
    @sanskariguru4463 ปีที่แล้ว

    thanks a lot brother

  • @arthurtaho4352
    @arthurtaho4352 ปีที่แล้ว

    thanks it work for me

  • @aadeshsatpute6309
    @aadeshsatpute6309 ปีที่แล้ว

    Thnx bro ❤

  • @rahuler3836
    @rahuler3836 ปีที่แล้ว

    thank you dear

  • @chhayashah8612
    @chhayashah8612 ปีที่แล้ว

    Nice video helpfula

  • @julionarvaezjn7047
    @julionarvaezjn7047 2 หลายเดือนก่อน

    you did hit with the solution

    • @baratkibaat
      @baratkibaat  2 หลายเดือนก่อน

      ❤️❤️

  • @dhruvsatyapanthi9766
    @dhruvsatyapanthi9766 ปีที่แล้ว

    Worked

  • @funnyanimation888
    @funnyanimation888 ปีที่แล้ว

    Thanks

  • @thewandererog
    @thewandererog ปีที่แล้ว

    thanks man

  • @soufianefatih5720
    @soufianefatih5720 ปีที่แล้ว

    thansk

  • @inhphucle7051
    @inhphucle7051 ปีที่แล้ว

    thanks

  • @abdulrahmanmuhd7794
    @abdulrahmanmuhd7794 ปีที่แล้ว

    thanks u

  • @abhishekkr23
    @abhishekkr23 ปีที่แล้ว

    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

    • @baratkibaat
      @baratkibaat  ปีที่แล้ว

      Follow this video th-cam.com/video/SBKG7zzKxAA/w-d-xo.html

  • @xhnahekai
    @xhnahekai ปีที่แล้ว

    good

  • @SURENDRASPORTS
    @SURENDRASPORTS 9 หลายเดือนก่อน

    Thank you so much

  • @arvamartin4468
    @arvamartin4468 ปีที่แล้ว

    Thanks Bro!!

  • @knowledge1329
    @knowledge1329 ปีที่แล้ว

    Thanks

  • @SG-yy1io
    @SG-yy1io ปีที่แล้ว

    Thanks