Cannot access http: // localhost: 28017 if auth is enabled for mongod

I cannot access http: // localhost: 28017 when auth is enabled for mongod; it always gives username / password, even if I fill in the username / password correctly. I included HTTP and REST in the initial parameter file.

YAML format parameters file that I use:

net:
port: 27017
http:
 enabled: true
 RESTInterfaceEnabled: true
 security:
 authorization: enabled

But when I turn off authorization mongod, I can enter http: // localhost: 28017 successfully, without having to enter a username / password.

What reason? Does the HTTP console support authorization for version 3.0? My version is 3.0.2.

+4
source share
2 answers

- HTTP/REST , , .

: MongoDB 3.0 defaults SCRAM-SHA-1 ( ) , 3.0 ( 2.6, , ). , , , HTTP/REST , 3.0 , .

, MONGODB-CR , REST. , , changeUserPassword, MONGODB-CR. - :

db.changeUserPassword("restuser", "SOh3TbYhx8ypJPxm", "MONGODB-CR")
+2

"MongoDB compass commiunity", mongodb, phpmyadmin mysql

0

All Articles