mongoDB的可视化连接过程(Navicat)mac版本
Posted 师兄白泽
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mongoDB的可视化连接过程(Navicat)mac版本相关的知识,希望对你有一定的参考价值。
1. 安装mongoDB
- Install Xcode Command-Line Tools
xcode-select --install
- Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install MongoDB
brew tap mongodb/brew
brew update
brew install mongodb-community@5.0
2. 启动mongoDB服务
- Run MongoDB Community Edition as a macOS service
brew services start mongodb-community@5.0
- To stop a mongod running as a macOS service
brew services stop mongodb-community@5.0
- Run MongoDB Community Edition manually as a background process
- intel processors
mongod --config /usr/local/etc/mongod.conf --fork
- M1 processors
mongod --config /opt/homebrew/etc/mongod.conf --fork
- if you want to stop MongoDB Community Edition manually as a background process,you should connect to the mongod using
mongosh
, and issue theshutdown
command as needed.
3. 测试MongoDB是否启动成功
- started MongoDB as a macOS service
brew services list
- started MongoDB manually as a background process
ps aux | grep -v grep | grep mongod
4. 连接MongoDB
- Open navicat and click connect, mongodb
- Customize the connection name and configure the url
How to view url?
- Enter
mongosh
in the console - Copy the green text
mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.3.1
to the navicat url
- Click Test Connection and you will see that the connection is successful
- Finally, click Save to complete the visual connection of mongoDB
以上是关于mongoDB的可视化连接过程(Navicat)mac版本的主要内容,如果未能解决你的问题,请参考以下文章
用 MongoDB Compass 可视化工具连接 MongoDB 数据库的详细过程