0%

个人博客相关

本地安装

1
2
brew tap mongodb/brew
brew install mongodb-community

Op1-作为mac服务

1
2
3
4
5
6
7
8
#启动
brew services start mongodb/brew/mongodb-community@7.0
# 查看 [hello-world.md](hello-world.md)
brew services list
# 停止
brew services stop mongodb/brew/mongodb-community@7.0
# 重启
brew services restart mongodb/brew/mongodb-community@7.0

Op2-手动启动

1
mongod --config /usr/local/etc/mongod.conf

8.0.9 default configuration

1
2
3
4
5
6
7
8
#log file 
# Op1方式:
/usr/local/var/log/mongodb/output.log

# Op2方式:
/usr/local/var/log/mongodb/mongo.log
# config
/usr/local/etc/mongod.conf

连接

1
mongosh "mongodb://localhost:27017"