Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set up bind_ip in MongoDB 3.6

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article shows you how to set up bind_ip in MongoDB 3.6. the content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

The following instructions and tests are mainly aimed at the first point.

In previous versions, after the Mongo service was started by default, you can log in directly using Server IP, but 3.6 has limited the default value of service startup bind_ip to localhost.

As a result, even if you log in with ServerIP on Local Server, you will get an error.

You can only log in using localhost

Modify the method, modify the conf configuration file, adjust the bind_ip parameter, and assign the local IP to this parameter. It is possible to log in using Server IP after giving it, but it fails to use localhost at this time. In order to be compatible with the two login methods at the same time, adjust the parameter assignment to:

Bind_ip=localhost,172.XXX.XXX.XXX

The middle is separated by a login number.

Verification shows that either of the two login methods can be configured with the above parameters.

Note: (1) if you do not want to do IP restrictions, you can assign bind_ip to 0.0.0.0 or enable another parameter bind_ip_all in the configuration file and set it to true.

Both of the above settings can satisfy localhost login and specified ServerIP login. When the bind_ip_all parameter is specified, there can be no bind_ip parameter in the configuration file.

(2) logging in to the default database is different. In version 3.6, the default connection database becomes test, while version 3.4 is the admin library by default. Therefore, when setting an administrator account with root permission, please first go to admin (because the account can only be queried in admin, it is recommended that the account with root permission be created in the admin database, and the account in the user database should be transferred to the user database). The deletion of the account must be deleted under the belonging database.

The above is how to set up bind_ip in MongoDB 3.6. have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report