In /etc/mongod.conf add:
security.authorization: enabled
then enter mongo:
mongo
use admin
db.createUser( { user: "root", pwd: "sql", roles: [ { role: "root", db: "admin" } ] } )