Guest User

Untitled

a guest
May 11th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. use admin
  2. var admin = {
  3. user:"admin",
  4. pwd:"123456",
  5. roles:[
  6. {
  7. role: "userAdminAnyDatabase",
  8. db:"admin"
  9. }
  10. ]
  11. }
  12. db.createUser(admin)
  13.  
  14. systemLog:
  15. destination: file
  16. path: /Users/me/Web/blog/setup/logs/mongodb/mongo.log
  17. logAppend: true
  18. storage:
  19. dbPath: /usr/local/var/mongodb
  20. net:
  21. port: 27017
  22. bindIp: 127.0.0.1
  23. security:
  24. authorization: enabled
  25.  
  26. mongo 127.0.0.1:27017 --authenticationDatabase admin -u admin -p
  27.  
  28. MongoDB shell version: 3.2.5
  29. Enter password:
  30. connecting to: 127.0.0.1:27017/test
  31. 2018-05-11T08:50:53.908+0300 E QUERY [thread1] Error: Authentication failed. :
  32. DB.prototype._authOrThrow@src/mongo/shell/db.js:1441:20
  33. @(auth):6:1
  34. @(auth):1:2
  35.  
  36. exception: login failed
Add Comment
Please, Sign In to add comment