mongoDB的可视化连接过程(Navicat)mac版本

Posted 师兄白泽

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mongoDB的可视化连接过程(Navicat)mac版本相关的知识,希望对你有一定的参考价值。

1. 安装mongoDB

  • Install Xcode Command-Line Tools
xcode-select --install
/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
  1. intel processors
mongod --config /usr/local/etc/mongod.conf --fork
  1. 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 the shutdown 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

  1. Open navicat and click connect, mongodb
  2. 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
  1. Click Test Connection and you will see that the connection is successful
  2. Finally, click Save to complete the visual connection of mongoDB

以上是关于mongoDB的可视化连接过程(Navicat)mac版本的主要内容,如果未能解决你的问题,请参考以下文章

mongoDB的可视化连接过程(Navicat)mac版本

mongoDB的可视化连接过程(Navicat)mac版本

navicat 可以连接mongodb吗?

用 MongoDB Compass 可视化工具连接 MongoDB 数据库的详细过程

Navicat Premium连接mongodb基本使用和介绍

Navicat远程连接MongoDB最全解决方法(教程报错)