Advertisement
Guest User

Untitled

a guest
Feb 26th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. connection error: { [MongoError: auth failed] name: 'MongoError', ok: 0, errmsg: 'auth failed', code: 18 }
  2.  
  3. 2015-06-13T15:10:09.863-0400 I ACCESS [conn8] authenticate db: mydatabase { authenticate: 1, user: "user", nonce: "xxx", key: "xxx" } 2015-06-13T15:10:09.863-0400 I ACCESS [conn8] Failed to authenticate user@mydatabase with mechanism MONGODB-CR: AuthenticationFailed UserNotFound Could not find user user@mydatabase
  4.  
  5. {
  6. "_id" : "mydatabase.user",
  7. "user" : "user",
  8. "db" : "mydatabase",
  9. "roles" : [
  10. {
  11. "role" : "readWrite",
  12. "db" : "mydatabase"
  13. }
  14. ]
  15. }
  16.  
  17. mongoose.connect('mongodb://user:password@host:port/mydatabase');
  18.  
  19. mongoose.connect('mongodb://host:port/mydatabase',{user: 'user',pass: 'password'});
  20.  
  21. mongo mydatabase -u user -p password
  22.  
  23. db.createUser({
  24. user: "user",
  25. pwd: "password",
  26. roles: [
  27. { role: "readWrite", db: "mydatabase" }
  28. ]
  29. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement