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 -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -