About connect with shell (cmd)

29 views
Skip to first unread message

Marco Antonio

unread,
Nov 14, 2017, 2:56:24 PM11/14/17
to mongodb-user

Hi 


I using the Robo 3T to connect my MongoDB. And after this I create a new user, using this command.



db.createUser(
  {
    user: "totvs_cons",
    pwd: "totvs123",
    roles: [ { role: "read", db: "VidaUnica" } ]
  }
);




When I go to the path file C:\Program Files\MongoDB\Server\3.4\bin    plus  mongo

I tried to connect but, show me this message. What I'm doing wrong ?






Rhys Campbell

unread,
Nov 15, 2017, 1:10:03 PM11/15/17
to mongodb-user
You are already connected. You are pasting your connect command into the mongo shell itself. Note the mongo shell prompt of > and the startup warnings...

Note you have no properly enabled authentication...

"Access control is not enabled for the database"


Once you have enabled authentication don't start mongo.exe using windows explorer but do this...

1. Open cmd
2. C:\Program Files\MongoDB\Server\3.4\bin\mongo authDB --username admin --password XXXX

See here for more...

Reply all
Reply to author
Forward
0 new messages