简体   繁体   中英

MongoDB + Adminer

I am running a local MongoDB service on Windows using WAMP64.

I want to access the db using Adminer. I cannot get thru the login page.

It keeps saying that Database does not support password , which it does as proven by me logging into the db using MongoDB Compass with the created auth uid and pw.

I have tried Adminer 4.6.3 and 4.7.6 (lastest v)

Anyone know how to get past this? Thanks.

The code that produces this message seems to be here .

What it appears to do is:

  1. Connect with the provided username and password.
  2. Connect with the provided username with an empty password.
  3. If the second connection succeeds, return the "does not support password" error.
  4. Otherwise, presumably return the first connection.

If I try to login without a password, even if mongod was not started with --auth parameter, my login fails. So I'm not sure what setup is needed to reproduce this behavior, but I suggest:

  1. Ensuring your mongod invocation has --auth parameter.
  2. Ensuring you are not able to connect to your server without specifying the password (ie, unauthenticated connection fails).

The thing you need to do is to add a user. You don't have to run mongo with authentication enabled; if you add a user adminer will accept the auth and just work. Just run mongo:

db.createUser({
... user: "admin",
... pwd: "PASSWORD",
... roles: ["readWrite","dbAdmin"]
... })

and then you'll be able to log in with adminer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM