Answer the question
In order to leave comments, you need to log in
How to fix incorrect behavior of mongodb during authorization?
Hello! In general, the bottom line: for authorization in mongo, I use the
mongo -u root -p pswd command,
the problem is that after it, mongo asks for a password again and connects to the pswd database.
I also tried to add --authenticationDatabase "dbname" to this command, but nothing has changed, for some reason mongodb after the key, where the password should be, considers it as the name of the database to which the connection should go. Based on this, node js has the same problem, it is impossible to log in at all. How to fix it?
Answer the question
In order to leave comments, you need to log in
helped reinstall the service and the correct start.
Firstly, we disable the mongodb service itself in /etc/init.d/ mongodb
and secondly, we use the command - mongod --auth
and of course, before that, the correct installation according to the recommendations in the official documentation.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question