MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017 | Intel macOS monterey
Asked Answered
M

6

5

I use macOS monterey (intel). I tried installing mongodb manually. Same problem. I used homebrew to install [email protected]. Same problem.

Nomatter what I try. I get this error. Please help!!!

Measured answered 11/8, 2022 at 13:46 Comment(2)
Did you start the MongoDB?Deboradeborah
Just upgrade macOS to 13.2 & 'mongodb-community' fails to run 6.0.3 & 6.0.4.Vinosity
V
13

For me, it worked just by stopping and starting the MongoDB community service

First Stop the service

brew services stop mongodb-community

then Start it again

brew services start mongodb-community

Vinavinaceous answered 3/11, 2022 at 9:10 Comment(0)
N
4

I have had exactly the same problem, though on an M1 Mac. After a lot of googling mongo.log messages and changing ownership and group of various files, I managed to get mongo up and running again by reverting to version 5.

The sequence which should get you up and running is:

brew services stop mongodb-community
brew install mongodb/brew/[email protected]
brew services start mongodb/brew/[email protected]

A quick check using mongosh indicated all was up and running with no loss of data. I made a copy of my data before I made any changes, just in case:

cd /opt/homebrew/var
cp -a mongodb mongodbsave
Nog answered 14/8, 2022 at 18:0 Comment(0)
V
0

Using MongoDB Community 7.0.2 perfectly. I've just upgraded macOS 14.2 (23C64).

Brew:

/usr/local/Cellar/mongodb-community/7.0.2/bin/install_compass
/usr/local/Cellar/mongodb-community/7.0.2/bin/mongod
/usr/local/Cellar/mongodb-community/7.0.2/bin/mongos
/usr/local/Cellar/mongodb-community/7.0.2/homebrew.mxcl.mongodb-community.plist
/usr/local/Cellar/mongodb-community/7.0.2/macos_mongodb.plist
/usr/local/Cellar/mongodb-community/7.0.2/MPL-2
/usr/local/Cellar/mongodb-community/7.0.2/THIRD-PARTY-NOTICES

Now I get:

brew services start mongodb-community
Error: undefined method `plist_startup’ for #
Did you mean? plist_name
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/lib/service/formula_wrapper.rb:71:in `service_startup?’
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/lib/service/services_cli.rb:280:in `service_load’
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/lib/service/services_cli.rb:122:in `block in start’
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/lib/service/services_cli.rb:97:in `each’
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/lib/service/services_cli.rb:97:in `start’
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/lib/service/commands/start.rb:12:in `run’
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/cmd/services.rb:130:in `services’
/usr/local/Homebrew/Library/Homebrew/brew.rb:86:in `’
MacBook-Pro-2:bin NOTiFY$

'FIXED'

Services not work:

brew services restart/stop/start

Could only work with:

./mongod --config /usr/local/etc/mongod.conf

Also:

'Brew' does not 'upgrade' to: MongoDB Community 7.0.4

Vinosity answered 13/12, 2023 at 11:34 Comment(0)
A
-1

There aren’t a lot of solutions for Mac that I could find, but this worked right away.

First stop the service

brew services stop mongodb-community

Then start it again

brew services start mongodb-community

Share Edit Follow

Adley answered 8/6, 2023 at 9:57 Comment(0)
A
-1

it worked for me:

stop the service

brew services stop mongodb-community

Then start it again

brew services start mongodb-community

Anisotropic answered 22/11, 2023 at 4:24 Comment(0)
C
-1

Just start the mongoDb services by using

brew services start mongodb-community

If the services are already working then first of all stop the services using

brew services stop mongodb-community

This solution will work for you..

Chassidychassin answered 26/4 at 4:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.