Advertisement
Guest User

Untitled

a guest
Mar 8th, 2016
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. sudo dnf install -y mongod
  2. sudo systemctl restart mongod
  3.  
  4. $ mongo
  5. MongoDB shell version: 3.0.9
  6. connecting to: test
  7. > show dbs
  8. 2016-03-08T14:45:58.188+0530 E QUERY Error: listDatabases failed:{
  9. "ok" : 0,
  10. "errmsg" : "not authorized on admin to execute command { listDatabases: 1.0 }",
  11. "code" : 13
  12. }
  13. at Error (<anonymous>)
  14. at Mongo.getDBs (src/mongo/shell/mongo.js:47:15)
  15. at shellHelper.show (src/mongo/shell/utils.js:630:33)
  16. at shellHelper (src/mongo/shell/utils.js:524:36)
  17. at (shellhelp2):1:1 at src/mongo/shell/mongo.js:47
  18. >
  19.  
  20. > db.createUser({user: "admin", pwd: "password", roles: [{role: "root", db: "admin"}]})
  21. 2016-03-08T14:48:34.595+0530 E QUERY Error: couldn't add user: not authorized on test to execute command { createUser: "admin", pwd: "xxx", roles: [ { role: "root", db: "admin" } ], digestPassword: false, writeConcern: { w: "majority", wtimeout: 30000.0 } }
  22. at Error (<anonymous>)
  23. at DB.createUser (src/mongo/shell/db.js:1101:11)
  24. at (shell):1:4 at src/mongo/shell/db.js:1101
  25. >
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement