MongoDB 在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专用。

官网下载

二、安装

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

1.安装首页
2.协议

下一步需要注意选择Custom

3.选择custom
4.自定义安装路径


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

5.data与Log目录的配置

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

6.视图界面不要勾选,直接next

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

MongoDB Compass
7.安装
8.完成安装

三、测试

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


    mongo命令
    1. 测试
> db
test
> show dbs
admin   0.000GB
config  0.000GB
local   0.000GB
>
测试
    1. 服务状态查看
      进入【服务】列表,找到MongoDB Server ,查看状态是否为正在运行。
      服务列表
    1. 访问 Http://localhost:27017
      http://localhost:27017

      It looks like you are trying to access MongoDB over HTTP on the native driver port.
      出现这个代表服务正常使用。默认端口:27017

猜你喜欢

转载自www.cnblogs.com/niuben/p/11242838.html