xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

MongoDB & macOS

MongoDB 4.2 Manual

https://docs.mongodb.com/manual/

install MongoDB

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

https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/#install-mongodb-community-edition

1. CLI install

$ brew tap mongodb/brew

# MongoDB Community Edition
$ brew install mongodb-community@4.2

# /usr/local/etc/mongod.conf
# /usr/local/var/log/mongodb
# /usr/local/var/mongodb

$ brew services list

# server
$ brew services start mongodb-community@4.2

$ brew services stop mongodb-community@4.2

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


$ ps aux | grep -v grep | grep mongod

# client
$ mongo

In addition to the binaries, the install creates:

the configuration file (/usr/local/etc/mongod.conf)
the log directory path (/usr/local/var/log/mongodb)
the data directory path (/usr/local/var/mongodb)

https://github.com/mongodb/homebrew-brew

https://docs.mongodb.com/manual/reference/configuration-options/

$ brew untap mongodb/brew && brew tap mongodb/brew

$ brew install mongodb-community@4.2

2. zip 手动安装 4.2.x

https://www.mongodb.com/try/download/community

https://www.mongodb.com/dr/fastdl.mongodb.org/osx/mongodb-macos-x86_64-4.2.8.tgz/download

跳过, 直接下载

https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-4.2.8.tgz

4.2.8

# download .tgz,  https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-4.2.8.tgz
$ cd Downloads 

# unzip
$ tar xzf mongodb-macos-x86_64-4.2.8.tgz

# move to  /usr/local/
$ sudo mv mongodb-macos-x86_64-4.2.8 /usr/local/mongodb 

$ sudo mkdir /data/db
# mkdir: /data: No such file or directory
$ sudo mkdir -p /data/db
mkdir: /data/db: Read-only file system

# macOS 14.x -
$ sudo mkdir -p /data/db

# macOS 15.x +
$ sudo mkdir -p /System/Volumes/Data/data/db

https://stackoverflow.com/questions/58034955/read-only-file-system-when-attempting-mkdir-data-db-on-mac

https://stackoverflow.com/questions/58034955/read-only-file-system-when-attempting-mkdir-data-db-on-mac

macOS 15.x upgrade bug

.zshrc

# mongodb ENV 2020.04.23
# export PATH=/usr/local/mongodb/bin:$PATH
export PATH="$PATH:/usr/local/mongodb/bin:$PATH"
# export PATH=":$PATH:/usr/local/mongodb/bin"

MongoDB GUI tools

  1. MongoDB Compass

  2. Robo 3T

Serverless API

Daas, Database as a Service

  1. MLab

refs

https://stackoverflow.com/questions/30678422/installing-mongodb

https://www.mkyong.com/mongodb/how-to-install-mongodb-on-mac-os-x/

https://coderwall.com/p/fb5dgg/the-best-mongodb-gui-for-mac-os-x

https://treehouse.github.io/installation-guides/mac/mongo-mac.html


Flag Counter

©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


原文地址:https://www.cnblogs.com/xgqfrms/p/9770091.html