mongodb - Enabling Access Control -


i installed mongo db , ran first time. encountered warning,

 access control not enabled database.  read , write access data , configuration unrestricted. 

i fixed enabling access control using these commands

 db.createuser(    {      user:"myusername",      pwd:"mypassword",      roles:[{role: "useradminanydatabase", db:"admin"}]   }) 

from docs, have restart mongodb command:

mongod --auth --port 27017 --dbpath /data/db 

but when try restart mongodb after access control, error.

2017-08-17t19:11:14.337+0530 e query    [thread1] syntaxerror: missing ; before statement @(shell):1:9 

is command wrong or missing here. please walk me through this. thanks.


Comments

Popular posts from this blog

angular - DownloadURL return null in below code -

python 2.7 - Given three nested dictionaries, sort the top two nested dictionaries from a value in the innermost dictionary? -