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

MongoDB errmsg access denied use admin db ok 0

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

When using MongoDB, sometimes the message "{" errmsg ":" access denied use admin db "," ok ": 0"} appears when executing certain commands, because these commands require use admin db. However, when using show dbs to view db, there is no amdin, because there is no parameter-- rest.

Use the following command when starting MongoDB:

Mongod.exe-- dbpath "c:\ Linda\ mongodb\ data\ db"-- rest

The result of using show dbs after startup is as follows:

> show dbs

Admin (empty)

Local (empty)

Students 0.203125GB

Test 0.203125GB

This allows you to use admin db to execute the corresponding command, and I'm executing db.runCommand ("listDatabases": 1}); the situation encountered by this command, which might be different if not a similar situation, needs to be resolved on its own.

In addition, if you encounter a listCommands that cannot open the management page, you can also use the secondary method to solve it.

Http://10.114.186.142:28017/_commands

Add-- the rest parameter starts and you can open the link above.

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