MongoDB 下载地址:https://www.mongodb.com/download-center/community
下载 .msi 文件,下载后双击该文件,按操作提示安装。
勾选
- I accept the terms in the License Agreement
安装过程中,通过点击 “Custom(自定义)” 按钮来设置安装目录。
根据自己的需要,设置MongoDB 安装的路径
MongoDB服务
以下是安装和配置MongoDB作为服务。
从MongoDB 4.0开始,可以在安装期间配置和启动MongoDB作为服务,并在成功安装后启动MongoDB服务。
选择 Run the service as Network Service user以网络服务用户身份运行服务(默认)
- Data Directory:数据存放的路径
- Log Dirctory::日志存放的路径
安装MongoDB Compass(界面化数据库管理工具)
下一步,安装 “Install mongoDB compass” 勾选(也可以不选择安装它)
MongoDB Compass 是一个图形界面管理工具,可以在后面自己到官网下载安装,下载地址:https://www.mongodb.com/download-center/compass
选择 Install
打开任务管理器,找到服务,查看 MongoDB 是否在运行,如果能找到 MongoDB 说明已经安装成功。
为MongoDB 配置环境变量
MongoDB 启动本地客户端
mongo
退出
exit
或者 ctrl + C