- open mongod.conf
sudo nano /etc/mongod.conf
- Comment security
#security:
# authroization: "enabled"
- Restart mongodb
sudo service mongod restart
- Run mongo
mongo
- Run these cmds
use admin
db.updateUser("admin", {pwd:"password"});
-
Enable auth again what you had commented in /etc/mongod.conf file (remove comments)
-
Restart mongod service again
-
DONE