MongoDB4.0在Windows环境的下载、安装、配置

MongoDB4.0在Windows环境的下载、安装、配置

今天本想玩玩MongoDB,可因工作机上未下载Linux虚拟机,下载多耗时。无奈只能先下载Windows版本耍耍。
不料,Windows在安装时也有不顺。

一、下载

地址官网:https://docs.mongodb.com/
如图。 话说MongoDB windows的安装包名称也有意思:mongodb-win32-x86_64-2008plus-ssl-4.0.0-signed.msi 。 咋一看还以为是WinServer2008专用。

《MongoDB4.0在Windows环境的下载、安装、配置》 官网下载

二、安装

安装时需要注意图形化界面的安装选择,非常非常耗时。。。
详细安装步骤比较简单,见图即可。

《MongoDB4.0在Windows环境的下载、安装、配置》 1.安装首页
《MongoDB4.0在Windows环境的下载、安装、配置》 2.协议

下一步需要注意选择Custom

《MongoDB4.0在Windows环境的下载、安装、配置》 3.选择custom

《MongoDB4.0在Windows环境的下载、安装、配置》 4.自定义安装路径

本次安装目录是:
D:\Program Files\MongoDB\Server\4.0\

《MongoDB4.0在Windows环境的下载、安装、配置》 5.data与Log目录的配置

这一步不要勾选“Install MongoDB Compass” ,这个选择后会去下载和Compass,很花费时间的!

《MongoDB4.0在Windows环境的下载、安装、配置》 6.视图界面不要勾选,直接next

如果需要MongoDB Compass,可以直接到官网下载,另外安装。

《MongoDB4.0在Windows环境的下载、安装、配置》 MongoDB Compass
《MongoDB4.0在Windows环境的下载、安装、配置》 7.安装

《MongoDB4.0在Windows环境的下载、安装、配置》 8.完成安装

三、测试

  • 1.打开cmd,到安装目录\bin下执行mongo,进入mongo命令模式。

    《MongoDB4.0在Windows环境的下载、安装、配置》 mongo命令

    1. 测试
> db
test
> show dbs
admin   0.000GB
config  0.000GB
local   0.000GB
>

《MongoDB4.0在Windows环境的下载、安装、配置》 测试

    1. 服务状态查看
      进入【服务】列表,找到MongoDB Server ,查看状态是否为正在运行。
      《MongoDB4.0在Windows环境的下载、安装、配置》 服务列表
    1. 访问 Http://localhost:27017
      《MongoDB4.0在Windows环境的下载、安装、配置》 http://localhost:27017
      It looks like you are trying to access MongoDB over HTTP on the native driver port.
      出现这个代表服务正常使用。默认端口:27017

本问参考了:https://blog.csdn.net/dorma_bin/article/details/80851230
https://blog.csdn.net/shu15121856/article/details/80736092

    原文作者:J先生有点儿屁
    原文地址: https://www.jianshu.com/p/72d7494b58f5
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞