How to Install MongoDB on Mac | Install MongoDB on macOS (2024)
ฝัง
- เผยแพร่เมื่อ 7 ต.ค. 2024
- 🍏📦 *No Homebrew Needed: How to Install MongoDB on Mac (M1, M2, M3, MacBook Pro, MacBook Air) Without Homebrew and Configure in Zsh!* 🚀🖥️
If you prefer not to use Homebrew, you can manually download and install MongoDB on your Mac. Additionally, we'll cover setting up MongoDB in the Zsh shell.
🌟 *Step-by-Step Guide:*
1. *Download MongoDB:*
Visit the official MongoDB website (www.mongodb.co...) and download the MongoDB Community Server for macOS.
2. *Extract the Archive:*
Once the download is complete, locate the downloaded file (usually a .tgz or .tar.gz archive) and extract it. You can do this by double-clicking on the file or using the terminal:
```bash
tar -zxvf /path/to/downloaded/mongodb-osx-ssl-x86_64-4.x.x.tgz
```
3. *Move MongoDB to /usr/local:*
Move the extracted MongoDB folder to `/usr/local` for easier access:
```bash
sudo mv mongodb-osx-ssl-x86_64-4.x.x /usr/local/mongodb
```
4. *Create Data Directory:*
MongoDB requires a data directory. Create one using:
```bash
sudo mkdir -p /usr/local/var/mongodb
```
5. *Set Permissions:*
Set proper permissions for the data directory:
```bash
sudo chown -R $(whoami) /usr/local/var/mongodb
```
6. *Add MongoDB Binaries to PATH:*
To access MongoDB from any location in the terminal, add the MongoDB binaries to your shell's PATH. If you're using Zsh, edit your Zsh configuration file (usually `~/.zshrc`):
```bash
nano ~/.zshrc
```
Add the following line at the end:
```bash
export PATH="/usr/local/mongodb/bin:$PATH"
```
Save and exit.
7. *Restart Zsh or Source the Configuration:*
Restart Zsh or source the updated configuration:
```bash
source ~/.zshrc
```
8. *Start MongoDB:*
Start MongoDB by running:
```bash
mongod --dbpath /usr/local/var/mongodb
```
9. *Verify Installation:*
Open a new terminal window and run the MongoDB shell:
```bash
mongo
```
You should see the MongoDB shell prompt.
10. *Explore MongoDB:*
You're ready to explore MongoDB! Use commands like `show dbs` and `use your_database_name` to get started.
11. *Stop MongoDB (Optional):*
If you want to stop MongoDB, press *Ctrl + C* in the terminal where MongoDB is running.
🚀 *Additional Tips:*
*Configure MongoDB as a Service (Optional):*
To run MongoDB as a service, create a launch agent plist file. Refer to the MongoDB documentation for detailed instructions.
*Upgrade MongoDB Version:*
To upgrade MongoDB, download the latest version, repeat the installation steps, and replace the old binaries.
🍃 *Congratulations! You've successfully installed MongoDB on your Mac without Homebrew and configured it to work seamlessly with Zsh!*
🍃 *Hashtags:*
#MongoDB #MacOS #DatabaseInstallation #TechTutorial #NoHomebrew #ZshConfiguration #DevelopmentEnvironment #ManualInstallation #TechHowTo
I was frustrated to install Mongodb on Mac but this video makes it so simple. Thanks for making
I was struggling with installation of MongoDB, you have solved problem like that. Amazing man.
Hi! I just wanted to say thank you so much for this tutorial. I have been struggling for days trying to figure out why my mongod was not working properly when installing with homebrew. I decided to install it the way you suggested and woah- the error was gone! Thanks again for being a lifesaver!
After Searching for an hour, then your video help me alot thanks for this video
I had to run brew install mongodb-community@7.0 and continue from 5:00. Thank you, it was helpful!
woah you saved my coding journey. such a complex installation of mongodb in mac explained in a simple step by step manner. Thanks :)
Thank you so much! this saved my life.
At 8:45 if your 'ls' ,'mkdir' or any other commands don't work, just copy paste the following in your .zshrc file and save -
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
thankksss
"Thanks a lot! This was really helpful for me and other users. Awesome blog video, thanks again!"
Thank you so much! This was a helpful and easy to follow tutorial. Very appreciated ❤
Very well prepared video step by step. Big Thanks for contributing to the community
this is the video i have been looking for for months thank you~~~
Thank you for this! I can assure you that it's working.
Excellent tutorial, thank you so much!
budddy love you you dont knwo how much i feel for you after running my mongo
Lazawaab , maza aagaya
every step goes so smoothly
thank you so much
Thank you for the video! Steps were very easy to follow and you went at a great pace.
Thanks for the step by step details to install mongodb in mac system. Very nicely explained.👌
Steps were very easy to follow. thanks.
This is my first comment on youtube just for you amazing explanation sir. Just looking like a wao.
Excellent my friend! It worked flawlessly.
Thanks a lot, very helpful video
Detailed instructions. Thanks!!
Thank you so much sir. plz keep it up😊
thank you so much man i was going to throm is mac opreators just frustrated the hell out of me man
Thank you, It was so helpful
thank you for the help
super helpful!
thankyou so much , very helpful
Fantastic video, thanks for the help!
Thanks, you're a lifesaver
It helped, Thank you!
thanks a lot for the video. Really helpful
Hi, thank you for the video it helped me a lot !!!!!!!
Thanks you very much. Your video helps me
Thank you Thank you Thank you!!!
Awesome video!
Thank you!
suoerb video.. Very well explained. Help me setup my mongo on mac
Bro gracias, probablemente no entiendas esto pero te quiero
Good explaination
great! easy ) thanks
bhai crazy hai tu
How to configurate the user and permissions locally, u would make a video?
I am sure this is a silly question, but here I go anyway : Is it necessary to have Mongo DB Shell installed as a requirement to install and run Mongo DB Compass?...
very useful
Thank you so much :)
Wow, u managed to make this waaaaay more complicated than it needs to be
Thanks bro !
in my mac it shows me a error to contact developer and says that the apple cannot scan this for malicious software
just go to system preferences > Privacy & Security > scroll down and click "allow anyways" mongod
Hello sir , i am having issue with this command which is sudo mongo -dbpath==/User/MacBook/data/db its showing me a pop-up message that includes mongo D cannot be opened because Apple cannot check it for malicious software. The software needs to be updated, contact developer for more information what to do please help me
same problem
Go to system preferences->security & privacy -> General and enable changes on this tab by clicking on the locker in the bottom of the page. Then allow mongod to be opened on your mac
How to restart server after successful installation
Thanks. I installed it with home brew following the instructions on MongoDB website. Any difference?
i have M1 macbook, which community server version should i download?
thanks, it worker fine
please help it is showing me
“mongod” can’t be opened because Apple cannot check it for malicious software.
System settings -> security and privacy -> allow apps to download from appstore
kral ya kral
Hi
My .zshrc file is locked because there is anaconda codes. So I can't paste the path there. Any solution for this issue?
Thankyou
thank you
hey i am not getting mongoshell option even it is enable to intract
Thank u !!!!!
touch: .zshrc: Permission denied.... can anyone give me a solution for this??
6:05 how select path in MacBook
What? A quarter of the way through the 21st Century and the mongodb software is straight out of the '80s. Can't believe any Mac owner would use it.
im having trouble running mongod in my terminal can anyone help
after following your video instructions for installing Mongodb my terminal is not working. Thank you
Mine too
Mine too. Please tell how did u fix it. Please
😢😢
Yeah, can anyone please help me how to do it
@@togariakshath29 guys, is it the same error as in my comment? If anyone got the same, please help me, I have an exam after tomorrow and I need mongo to work
but mongo command done not work
its better to use homebrew
After closing the connection with Mongod terminal will the compass work or do I have to keep it running in the background to work on the compass?
there is an error saying "mongod" cant be opened becuase apple cannot check it for malicious software -this software neeeds to be updated. contact the developer for more information 'what should i do now"
for this issue click on apple icon-> go to system setting-> security and privacy-> scroll down you'll see something like "mongod" something click on "open anyway"
bro how to stop the services running i have 2 services running how to stop them
after someday, if we want to try to open mongo db compass , it shows an error while connecting i.e ECONNREFUSED like this? why?
how did you fix it??????
@@rajatpanwal Yes , it is fixed now , we have to use that last command in our terminal.
Just curious, has anyone ever gotten mongodb to work on a mac - without compass?
give me the command for restart the mongodb server by any chance if it get closed
hello can anyone tell me how to install mongo db shell on M1 CHIP , it's giving me a lot of issues
At 8:03 my mongod command isn’t working, it says:
‘“mongod” can’t be opened because Apple cannot check it for malicious software. This software needs to be updated. Contact the developer for more information.’ And it gives me two options, “Show in Finder” and “OK”
What the hell do I do?
after running the command, just open your system preferences then go to privacy and security scroll down and then you can see mongod will be blocked, just click on allow there and other steps will work as you move through the video!
Hello how to create partition in Ubuntu doing video
Thank you for the great tutorial. I got stuck on security issues where my mac would kill the command, if anyone else is having security issues with their mac I used this video to trouble shoot: th-cam.com/video/wpJnigMKFmQ/w-d-xo.html. Othere than that this video has everything you need to get going with mongo on mac.
how to download mongodb -buy a windows
very frustating using mac fuck ittttttttttt!!!!!!!!!!!!!!!!!!!!!!!
My problem is mkdir: /data: Read-only file system, but I create another directory by enter: mkdir -p ~/mongodb/data, then use chmod -R 755 ~/mongodb/data to make sure I owned thsi directory, then use --dbpath option to specify the new directory when starting mongod:mongod --dbpath ~/mongodb/data. Finally fix this issue.
Bootstrap failed: 5: Input/output error
ta**************@T****-Laptop ~ % brew services start mongodb-community@7.0
Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/ta************/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist` exited with 5.
I am facing this issue while starting the Mongodb server. Can you suggest?
Hello, I'm trying to install MongoDb but I have a problem ".zshrc" part.
When I type "source .zshrc" on terminal, I'm getting this error:
".zshrc:export:15: not valid in this context: /Users/XXX/mongodb-macos-aarch64-7.0.6/bin"
And I did all the things in the video, one by one.
***
.zshrc path is =
export PATH=${PATH}: /Users/XXX/mongodb-macos-aarch64-7.0.6/bin
I need help about error.
ok ok I got it :) I left 1 space while writing, before "/Users". 😬 Now it's working.
Thank you so much... this was fantastic. Very thorough too.
thnnks for such nice video , great job
Thank you so much!
excellent, very helpful
Big Thanks sir
Thank you soo much :)
Thankyou so much, that video is really helpful
Thank you very much!
Thanks helped me
Thank you!
Thank you!