> For the complete documentation index, see [llms.txt](https://shrutisantosh.gitbook.io/head-scratching-sde/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shrutisantosh.gitbook.io/head-scratching-sde/mongo-gone.md).

# Mongo gone

One thing leads to another, and now I can't connect to my data base

<figure><img src="https://428485900-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg8Z67hWT3M8ahFC9cRdj%2Fuploads%2FIqVeaTmt8tJHwdViaNbd%2Fimage.png?alt=media&amp;token=de948292-3f9e-4bc7-ab11-122e2cc6cd39" alt="MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017"><figcaption><p>MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017</p></figcaption></figure>

This all started when I wanted to connect my docker (not surprising) container to database. On the same port. I don't exactly remember what I did, but it got connected, but now I am not able to connect to the database on my local machine, it keeps throwing me CONNREFUSED on 27017

When I do a `brew services list` I was getting status of error.&#x20;

<figure><img src="https://428485900-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg8Z67hWT3M8ahFC9cRdj%2Fuploads%2Fc2By0ShegoXyed3XdoKg%2Fimage.png?alt=media&amp;token=2e7dd5b2-b52c-4da1-8fff-f5a67bb297f4" alt=""><figcaption><p>This error was showing up for mongodb-community@4.4 too</p></figcaption></figure>

BUT WAIT

When I opened Mongo Compass RIGHT NOW, it started working again. Agh! This life if indeed funny.&#x20;

*I might think it was magic (which is one of the possibilities)* \
*But it also could be all the countless times I have*<br>

* uninstalled mongodb-community&#x20;
* reinstalled
* run `mongosh`&#x20;
* run `brew services start/stop mongodb-community`

**It is funny, because it only worked for a while, now it stopped again.**&#x20;

{% embed url="<https://www.mongodb.com/basics/uninstall-mongodb>" %}

Date: 4 June 2023<br>

This document was created at least 5 days ago, I'm not sure. **Anyway what helped, is this document**

{% embed url="<https://www.mongodb.com/community/forums/t/help-brew-mongodb-community-5-0-error-macos/125648/3>" %}

Saw this man on various mongo help I encountered. <br>

> Not all heroes wear capes, some are behind a computer screen

Thank you Ramachandra Tummala. Whoever you are, you saved me.&#x20;
