Problems and solutions encountered when installing MongoDB through brew on MAC

Today I will introduce how to install MndogDB through brew in mac system, as well as the problems encountered and perfect solutions.

1. Whether brew is installed on mac: brew -v

The following message appears, indicating that brew has been installed
Insert image description here

2. Direct installation: brew install mongodb

Insert image description here
It is possible that the installation will be successful directly at this step, but the above information clearly indicates an error:Error: No available formula with the name "mongodb"

3. Solve the error: brew tap mongodb/brew

Insert image description here

4. Continue installation (community version): brew install mongodb-community

Insert image description here
Then I found out and continued to report errors...

5. Solve the error: brew install gcc

Insert image description here
Um...it's still an error, so let's continue to solve it...

6. Continue to solve the error: xcode-select --installInsert image description here
7. Final installation: brew install [email protected] (the latest community version on the official website)

Insert image description here

8. Verify whether the installation is successful: mongod --version

Insert image description here
Ok, the following message appears, indicating that the installation is successful and you can use the powerful mongodb normally~~

Reference: https://docs.mongodb.com/master/tutorial/install-mongodb-on-os-x/

Guess you like

Origin blog.csdn.net/ganyingxie123456/article/details/105497746