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

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -