I am not sure what I need to do. Every time I try to run the mongo shell on Linux I get an error asking me to stop the database before running MongoDB with start-noauth. I am not sure how to do that. Can you help me out?
I have tried to stop and exit MongoDB but the issue still exists.
2
Answers
if you dont want shutdown the "usually way":
you can stop like this:
In general it does not look very smart if you want to restart your MongoDB without authentication when authentication is actually enabled. Usually there is a reason to have authentication enabled.
The proper way would be to stop the MongoDB
and then disable authentication in your configuration file, typically at
/etc/mongod.conf
:Then you can restart the service with
If you don’t know the location of the config file, check the service file:
Above commands apply for Redhat/CentOS Linux, they may differ on your Linux.
But as said, usually it is a good habit to enable authentication and I would assume there was a reason to enable it.