E
E
Evgeny Zapunny2022-03-30 14:46:06
MongoDB
Evgeny Zapunny, 2022-03-30 14:46:06

Why is mongodb not logging in?

I create a user inside the database, to which the database says okay

> db.createUser({
...     user:"evgzap",
...     pwd:"evgzap",
...     roles:["readWrite", "dbAdmin"]
... })
Successfully added user: { "user" : "evgzap", "roles" : [ "readWrite", "dbAdmin" ] }


I go into the compass from the same PC, I try to connect, but the answer is such an error
{"t":{"$date":"2022-03-30T14:29:15.987+03:00"},"s":"I",  "c":"ACCESS",   "id":20249,   "ctx":"conn16","msg":"Authentication failed","attr":{"mechanism":"SCRAM-SHA-1","speculative":false,"principalName":"evgzap","authenticationDatabase":"roomix","remote":"192.168.88.1:61945","extraInfo":{},"error":"UserNotFound: Could not find user \"evgzap\" for db \"roomix\""}}


despite the fact that I create a user inside the database to which I am trying to connect.

Maybe I made a mistake somewhere at the very beginning, because if I connect to the compass via localhost, and not an external ip, then there are no problems at all, no, I can even abort the execution, authentication will still work, but if you try through an external one, then No

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question