Install MongoDB 4.2, as well as solutions to common problems

In Win10 installation MongoDB4.2 Community Edition

1. Download the MongoDB community win64 version of the .msi installer

2. Run the installation program MongoDB

Up next, below this step, the type of installation, select Custom (Custom), to specify our own proper installation location:

Modify the installation path:

Starting MongoDB 4.0, MongoDB can during installation as a Windows service, and start the MongoDB service after successful installation

The following database path, log output file path can not be changed directly next

Here you can choose whether to install a graphical tool mongodb compass, then check the installation time will be longer

 

 Check mongodb compass, then the installation time will be longer

The installation is complete

After installation file directory below

View MongoDB service, has been launched:

Simple Authentication MongoDB whether the installation is successful, the browser visit http: // localhost: 27017 /,

Output page: It looks like you are trying to access MongoDB over HTTP on the native driver port it shows the default port of 27017 MongoDB has been outside for service.

 

mongodb comes with 3 database

-------------------------------------------------------------------------------------------------------------------------------------

问题1,MongoDB安装错误:The installer has encountered an unexpected error installing this package. This may indicate a problem with this package.The error code is 2503.

Translation: The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2503.

the reason:

This error is because the mechanism window 10, and have to be run as administrator.

solve:

The installation program using an administrator (win x -> a -> full path setup file -> enter), as shown below:

-------------------------------------------------------------------------------------------------------------------------------------

Question 2, MongoDB remote connection fails, an error Exception opening socket

the reason:

mongodb.cfg profile bindIp 127.0.0.1,127.0.0.1 only allows local connection is not accept remote connections mongodb

What bindIp that?

bindIp is localhost, which forces the server to only listen for requests on the localhost IP. Only bind to secure interfaces that the application-level systems can access with access control provided by system network filtering (i.e. “firewall”).

bindIp if localhost, which will force the server to listen only on request on localhost. Only bind to application-level filtering system can be used by the system to provide network access control (ie, "firewall") security interface access.

Official .deb and Installed from the mongod .rpm Packages Standard Package at The bind_ip have have the SET to the Configuration 127.0.0.1 by default.
the mongod official .deb and .rpm installation package bind_ip default setting is 127.0.0.1.

 solve:

BindIp must be changed to 0.0.0.0 (the bindIp: 127.0.0.1 comment out this line can not connect remotely)

 

The End

 

 

 

 

Published 23 original articles · won praise 6 · views 10000 +

Guess you like

Origin blog.csdn.net/weixin_42046751/article/details/103464881