How to Install MongoDB on Mac | Install MongoDB on macOS (2024)

Поделиться
HTML-код
  • Опубликовано: 28 сен 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

Комментарии • 113

  • @ibrahimthecoder
    @ibrahimthecoder 3 месяца назад +5

    I was frustrated to install Mongodb on Mac but this video makes it so simple. Thanks for making

  • @amitpareek9117
    @amitpareek9117 8 дней назад

    I was struggling with installation of MongoDB, you have solved problem like that. Amazing man.

  • @krittiyaclark
    @krittiyaclark 4 месяца назад

    I had to run brew install mongodb-community@7.0 and continue from 5:00. Thank you, it was helpful!

  • @samsstandup9149
    @samsstandup9149 Месяц назад +3

    in my mac it shows me a error to contact developer and says that the apple cannot scan this for malicious software

    • @arulpraveen
      @arulpraveen Месяц назад +2

      just go to system preferences > Privacy & Security > scroll down and click "allow anyways" mongod

  • @bibaswanchakma6471
    @bibaswanchakma6471 7 месяцев назад +1

    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"

  • @deemah683
    @deemah683 4 месяца назад +1

    Thank you so much! This was a helpful and easy to follow tutorial. Very appreciated ❤

  • @md.rafiulbiswas4553
    @md.rafiulbiswas4553 5 месяцев назад +1

    Very well prepared video step by step. Big Thanks for contributing to the community

  • @rajeshjangid4617
    @rajeshjangid4617 2 месяца назад

    "Thanks a lot! This was really helpful for me and other users. Awesome blog video, thanks again!"

  • @prixescalator5764
    @prixescalator5764 5 дней назад

    Excellent tutorial, thank you so much!

  • @sandeepvinay7
    @sandeepvinay7 6 месяцев назад

    Thanks for the step by step details to install mongodb in mac system. Very nicely explained.👌

  • @taed13
    @taed13 Месяц назад

    this is the video i have been looking for for months thank you~~~

  • @itsmenavyaaaa
    @itsmenavyaaaa 6 месяцев назад +1

    i have M1 macbook, which community server version should i download?

  • @AyushSingh-lb5jt
    @AyushSingh-lb5jt 3 месяца назад

    Lazawaab , maza aagaya
    every step goes so smoothly
    thank you so much

  • @dixavier27
    @dixavier27 27 дней назад

    How to configurate the user and permissions locally, u would make a video?

  • @AliHassan-sm1cv
    @AliHassan-sm1cv 6 месяцев назад

    This is my first comment on youtube just for you amazing explanation sir. Just looking like a wao.

  • @oariasz72
    @oariasz72 6 месяцев назад

    Excellent my friend! It worked flawlessly.

  • @mistersir3185
    @mistersir3185 6 месяцев назад +1

    Thank you for this! I can assure you that it's working.

  • @rahulsahu5988
    @rahulsahu5988 4 месяца назад

    budddy love you you dont knwo how much i feel for you after running my mongo

  • @AbhaySingh-ok2ol
    @AbhaySingh-ok2ol Месяц назад

    thank you so much man i was going to throm is mac opreators just frustrated the hell out of me man

  • @princethakkar6642
    @princethakkar6642 Месяц назад

    im having trouble running mongod in my terminal can anyone help

  • @TheJomad
    @TheJomad 19 дней назад

    super helpful!

  • @raider4407
    @raider4407 4 месяца назад +4

    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

    • @Nitrox_settings
      @Nitrox_settings 4 месяца назад

      same problem

    • @bocamaster
      @bocamaster 4 месяца назад +4

      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

  • @kingannon4131
    @kingannon4131 5 месяцев назад

    Fantastic video, thanks for the help!

  • @iamakramfaiz
    @iamakramfaiz 5 месяцев назад

    thanks a lot for the video. Really helpful

  • @siyarana1379
    @siyarana1379 2 месяца назад

    thankyou so much , very helpful

  • @dhakaluma3613
    @dhakaluma3613 6 месяцев назад +1

    after someday, if we want to try to open mongo db compass , it shows an error while connecting i.e ECONNREFUSED like this? why?

    • @rajatpanwal
      @rajatpanwal 2 месяца назад

      how did you fix it??????

    • @dhakaluma3613
      @dhakaluma3613 2 месяца назад +1

      @@rajatpanwal Yes , it is fixed now , we have to use that last command in our terminal.

  • @lachezarninkov
    @lachezarninkov 4 месяца назад

    Hi, thank you for the video it helped me a lot !!!!!!!

  • @vishnuvardhanvankayalapati7703
    @vishnuvardhanvankayalapati7703 Месяц назад

    It helped, Thank you!

  • @armindervic9497
    @armindervic9497 4 месяца назад

    Awesome video!

  • @nawwintphyu1873
    @nawwintphyu1873 2 месяца назад

    Thank you so much!

  • @Nothingtosaymore
    @Nothingtosaymore 18 дней назад

    6:05 how select path in MacBook

  • @suneel8715
    @suneel8715 6 месяцев назад

    Good explaination

  • @AbhishekMishra-qw3cd
    @AbhishekMishra-qw3cd 6 месяцев назад

    give me the command for restart the mongodb server by any chance if it get closed

  • @aniketkhandagale5098
    @aniketkhandagale5098 2 месяца назад

    suoerb video.. Very well explained. Help me setup my mongo on mac

  • @ovijitkarmakar7804
    @ovijitkarmakar7804 Месяц назад

    but mongo command done not work

  • @EminYusifov
    @EminYusifov 3 месяца назад

    great! easy ) thanks

  • @kia8609
    @kia8609 6 месяцев назад

    Thank you so much :)

  • @emekatimothyiloba699
    @emekatimothyiloba699 2 месяца назад

    Big Thanks sir

  • @santd3400
    @santd3400 5 месяцев назад

    Thanks bro !

  • @dh1569
    @dh1569 5 месяцев назад

    Just curious, has anyone ever gotten mongodb to work on a mac - without compass?

  • @ReddyReddy-o7n
    @ReddyReddy-o7n 8 месяцев назад

    Hello how to create partition in Ubuntu doing video

  • @Ferassharkh
    @Ferassharkh 6 дней назад

    very useful

  • @cesarmotril
    @cesarmotril 7 месяцев назад +1

    Bro gracias, probablemente no entiendas esto pero te quiero

  • @Crisgonzalez94
    @Crisgonzalez94 Месяц назад

    Thankyou

  • @BhupeshKumarSinghBCE
    @BhupeshKumarSinghBCE 3 месяца назад

    thanks, it worker fine

  • @liderbektas3097
    @liderbektas3097 2 месяца назад

    kral ya kral

  • @shreyaschaudhary-r6d
    @shreyaschaudhary-r6d 4 месяца назад

    thank you

  • @casket_kicker
    @casket_kicker 5 месяцев назад +2

    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: ruclips.net/video/wpJnigMKFmQ/видео.html. Othere than that this video has everything you need to get going with mongo on mac.

  • @tausifkazi3205
    @tausifkazi3205 2 месяца назад

    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?

  • @thehalise
    @thehalise 6 месяцев назад

    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.

    • @thehalise
      @thehalise 6 месяцев назад

      ok ok I got it :) I left 1 space while writing, before "/Users". 😬 Now it's working.

  • @nitishkumarjakkula1724
    @nitishkumarjakkula1724 13 дней назад +1

    very frustating using mac fuck ittttttttttt!!!!!!!!!!!!!!!!!!!!!!!

  • @rcstevenson6
    @rcstevenson6 7 месяцев назад

    Thank you so much... this was fantastic. Very thorough too.

  • @rahuljha972
    @rahuljha972 3 месяца назад

    thnnks for such nice video , great job

  • @ГерманХамитов-ж4ь
    @ГерманХамитов-ж4ь 5 месяцев назад

    Thank you very much!

  • @vipundenuwan9293
    @vipundenuwan9293 5 месяцев назад +2

    Hi
    My .zshrc file is locked because there is anaconda codes. So I can't paste the path there. Any solution for this issue?

  • @arafathussain851
    @arafathussain851 3 месяца назад

    Thank you!

  • @sunnykulshrestha2155
    @sunnykulshrestha2155 3 месяца назад

    Thanks helped me

  • @VivekYadavOfficial
    @VivekYadavOfficial День назад

    After Searching for an hour, then your video help me alot thanks for this video

  • @gaurviisood7072
    @gaurviisood7072 3 месяца назад +1

    please help it is showing me
    “mongod” can’t be opened because Apple cannot check it for malicious software.

    • @kanishkayadav4007
      @kanishkayadav4007 2 месяца назад +1

      System settings -> security and privacy -> allow apps to download from appstore

  • @akshithanilkumar8557
    @akshithanilkumar8557 День назад

    touch: .zshrc: Permission denied.... can anyone give me a solution for this??

  • @frankpulido873
    @frankpulido873 2 дня назад

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

  • @igreels1033
    @igreels1033 4 месяца назад +1

    How to restart server after successful installation

  • @jinluwang5671
    @jinluwang5671 5 месяцев назад +1

    Thanks. I installed it with home brew following the instructions on MongoDB website. Any difference?

  • @janpoonthong
    @janpoonthong 14 дней назад

    Thanks a lot, very helpful video

  • @DA-rf7zj
    @DA-rf7zj 16 дней назад

    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.

  • @elyse2717
    @elyse2717 4 дня назад

    Thank you Thank you Thank you!!!

  • @abdulragib6004
    @abdulragib6004 2 месяца назад

    its better to use homebrew

  • @RitikGupta060
    @RitikGupta060 13 дней назад

    hey i am not getting mongoshell option even it is enable to intract

  • @opmarathi64
    @opmarathi64 7 месяцев назад +1

    Thank you so much sir. plz keep it up😊

  • @sanoj1736
    @sanoj1736 Месяц назад

    Thank you!

  • @soham5791
    @soham5791 Месяц назад

    bhai crazy hai tu

  • @rachdev_codeur
    @rachdev_codeur 4 месяца назад

    Thanks you very much. Your video helps me

  • @sinnie.62.
    @sinnie.62. 4 месяца назад

    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?

  • @MuhdHanish
    @MuhdHanish 4 месяца назад

    bro how to stop the services running i have 2 services running how to stop them

  • @LycheeLele-mh2ku
    @LycheeLele-mh2ku Месяц назад

    Wow, u managed to make this waaaaay more complicated than it needs to be

  • @joKerchy
    @joKerchy 6 месяцев назад

    Thank you soo much :)

  • @SRUSHTIHIRVE-h2l
    @SRUSHTIHIRVE-h2l 6 месяцев назад

    hello can anyone tell me how to install mongo db shell on M1 CHIP , it's giving me a lot of issues

  • @قهقان
    @قهقان 2 месяца назад

    Thanks, you're a lifesaver

  • @Pragna-bd8cf
    @Pragna-bd8cf 3 месяца назад

    Steps were very easy to follow. thanks.

  • @ytrollers
    @ytrollers 5 месяцев назад

    Thankyou so much, that video is really helpful

  • @ABDELAZIZCHAIMA
    @ABDELAZIZCHAIMA Месяц назад

    Thank you, It was so helpful

  • @ettyobz
    @ettyobz 5 месяцев назад

    excellent, very helpful

  • @wonderweebwoman
    @wonderweebwoman 5 месяцев назад

    Detailed instructions. Thanks!!

  • @Programming-for-all-u2l
    @Programming-for-all-u2l 6 месяцев назад +9

    after following your video instructions for installing Mongodb my terminal is not working. Thank you

    • @annnaaa1510
      @annnaaa1510 5 месяцев назад

      Mine too

    • @_DivyaBharti
      @_DivyaBharti 4 месяца назад

      Mine too. Please tell how did u fix it. Please

    • @_DivyaBharti
      @_DivyaBharti 4 месяца назад

      😢😢

    • @togariakshath29
      @togariakshath29 4 месяца назад

      Yeah, can anyone please help me how to do it

    • @alikhaled2389
      @alikhaled2389 3 месяца назад

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

  • @Joncito95
    @Joncito95 5 месяцев назад

    Thank you for the video! Steps were very easy to follow and you went at a great pace.

  • @FrancisLukoki-t8c
    @FrancisLukoki-t8c 7 месяцев назад

    Thank u !!!!!

  • @alikhaled2389
    @alikhaled2389 3 месяца назад

    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?

    • @ajjayadhithyav8873
      @ajjayadhithyav8873 2 месяца назад

      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!

  • @favourdaniel2410
    @favourdaniel2410 7 месяцев назад

    Thank you!

  • @nabeanrokaya3691
    @nabeanrokaya3691 2 месяца назад

    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"

    • @simranm.552
      @simranm.552 Месяц назад +1

      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"

  • @KnowledgeBoxInfinity
    @KnowledgeBoxInfinity 7 месяцев назад +3

    woah you saved my coding journey. such a complex installation of mongodb in mac explained in a simple step by step manner. Thanks :)

  • @kunli1205
    @kunli1205 Месяц назад

    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.