分享

mongodb安装

 李xinle 2020-07-12

1.下载

https://www./download-center#community

https://fastdl./win32/mongodb-win32-x86_64-2008plus-ssl-3.0.6-signed.msi

由于下载速度慢,先ping一下

C:\Windows\System32\drivers\etc\ 下hosts文件在末尾加上 54.175.147.155  www.。关闭浏览器重新下载。


2.安装

安装MongoDB 4.28 2008R2Plus SSL (64 bit) setup 
Welcome to the MongoDB 4.2.8 
2008R2Plus SSL (64 bit) setup Wizard 
The setup Wizard will install MongoD8 4.2.8 2008R2Plus SSL 
(64 bit) on your computer. Click NeR to continue or Cancel to 
x 
exit the Setup Wizard. 
Back 
Cancel

MongoDB 4.28 2008R2Plus SSL (64 bit) setup 
End-User License Agreement 
Please read the following license agreement carefully 
Server Side Public License 
VERSION 1, OCTOBER 16, 2018 
Copyright C 2018 MongoDB, Inc. 
Evelyone is permitted to copy and distribute verbatim copies of 
this 
license document, but changing it is not allowed. 
TERMS AND CONDITIONS 
Z]$I accept the terms in the License Agreement 
x 
Print 
Back 
Cancel

选择custom

MongoDB 4.28 2008R2Plus SSL (64 bit) setup 
Choose Setup Type 
Choose the setup type that best suits your needs 
Complete 
All program features will be installed. Requires the most disk space. 
Recommended for most users. 
x 
Custom 
Allows users t 
will be instal 
tures will be installed and where they 
Custom Installation 
users. 
Back 
Cancel

MongoDB 4.28 2008R2Plus SSL (64 bit) setup 
Custom Setup 
Select the way you want features to be installed. 
Click the icons in the tree below to change the way features will be installed. 
x 
4.2.8 2008R2PIus SSL (64 
C:\Program 
Disk Usage 
MongoD8 4.2.8 2008R2Plus SSL (64 
This feature requires 285K8 on your 
hard drive. It has 6 of 6 subfeatures 
selected. The subfeatures require 
440M8 on your hard drive. 
Location: 
Back 
Browse... 
Cancel

选择自己的安装路径

MongoDB 4.28 2008R2Plus SSL (64 bit) setup 
Custom Setup 
Select the way you want features to be installed. 
Click the icons in the tree below to change the way features will be installed. 
x 
4.2.8 2008R2PIus SSL (64 
D:\mongodb\ 
Disk Usage 
MongoD8 4.2.8 2008R2Plus SSL (64 
This feature requires 285K8 on your 
hard drive. It has 6 of 6 subfeatures 
selected. The subfeatures require 
440M8 on your hard drive. 
Location: 
Back 
Browse... 
Cancel

MongoDB 4.28 2008R2Plus SSL (64 bit) Service Custo... 
Service Configuration 
Specify optional settings to configure MongoD8 as a service. 
Z] Install MongoD as a Service 
@Run service as Neüork Service usefi 
C) Run service as a local or domain user: 
Account Domain 
Account Name 
Account Password 
Service Name: 
Data Directory: 
Log Directory: 
MongoD8 
MongoD8 
D: \ mongodb\log\ 
< Back 
Cancel

MongoDB Compass 
Install MongoDB Compass 
MongoD8 Compass is the official graphical user interface for MongoD8. 
By checking below this installer will automatically download and install the latest 
version of MongoD8 Compass on this machine. You can learn more about 
MongoD8 Compass here: https://vmw./products/compass 
x 
ØInstall MongoD8 Compass 
Back 
Cancel

MongoDB 4.28 2008R2Plus SSL (64 bit) setup 
Ready to install MongoDB 4.2.8 2008R2Plus SSL (64 bit) 
Click Install to begin the installation. Click Back to review or change any of your installation 
x 
settings. Click Cancel to exit the wizard. 
Back 
Install 
Cancel

MongoDB 4.28 2008R2Plus SSL (64 bit) setup 
Installing MongoDB 4.2.8 2008R2Plus SSL (64 bit) 
Please wait while the Setup Wizard installs MongoD8 4.2.8 2008R2Plus SSL (64 bit). 
Status: 
Updating component registration 
x 
Cancel

最后出现一个弹窗警告,ignore就可以。

data下创建两个文件夹,dblogs

在浏览器中输入localhost:27017,出现如下说明成功了

 

ifiZFi*Ä: C:\WlNDOWS\system32\cmd.exe 
icrosoft Windows 10. 0. 17134. 254] 
(c) 2018 Microsoft Corporation, 
· start MongoDB 
ongoDB 
ongoDB 
: 100. 
iBfEA NET HELPMSG 3547

 输入:mongod -dbpath "g:\mongodb\data\db" -logpath "g:\mongodb\data\log\mongo.log" –install -serviceName "MongoDB",MongoDB就是启动的名字

如果输入次命令出现错误的话,先删除服务sc delete MongoDB,再次输入上个命令就好了

https://images2018.cnblogs.com/blog/1188378/201808/1188378-20180806140800141-395463212.png

删掉data\db中的mongod.lock文件

 

bin目录下启动命令行输入mongo启动服务,开始使用

    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多