Before looking for a long time on the Internet, always in the configuration of the environment, there are problems, especially when mongodb is installed, will not automatically create log files, to create data/ DB in the root directory, but the new OS system, do not allow to create files in the root directory, and to disable SIP, and to restart, after this operation, The person who changed the SIP configuration said the system kept rebooting me after the change.
Brew installation of mongodb is recommended here, requiring only two steps and no additional configuration of the environment
First of all,
// Switch the mongodb image
brew tap mongodb/brew
// Install the latest available production version of the MongoDB community server (including all command-line tools) :
brew install mongodb-community
// Install the specified version @ followed by the version number
brew install mongodb-community@4.2
Copy the code
The last
/ / start the mongo
brew services start mongodb-community
/ / open the mongo
mongo
/ / close the mongo
brew services stop mongodb-community
Copy the code
Finally: Database management tools recommend Robo 3T