Error Message: MongoError: bad auth Authentication failed through URI string

前端 未结 15 1734
终归单人心
终归单人心 2020-12-29 02:36

I\'m trying to connect to my mongoDB server via the connection string given to me by mongo:

"mongodb+srv://david:p         


        
相关标签:
15条回答
  • 2020-12-29 02:59

    Works great!!

    0 讨论(0)
  • 2020-12-29 03:03

    I forgot to update the user after generating and copying the password and was wondering why it wasn't working. I saw the update button later. I was not visible to me earlier. lol. Solved the problem.

    Database Access => edit user => generate/copy password => update it! It worked for me.

    remember to make sure you have updated it.

    0 讨论(0)
  • 2020-12-29 03:04
    mongodb+srv://jehat123:<password>@jehatarmancdeniz-x2yf7.mongodb.net/question-answer?retryWrites=true&w=majority
    

    Delete all of password part

    Use like this:

    mongodb+srv://jehat123:yourpass@jehatarmancdeniz-x2yf7.mongodb.net/question-answer?retryWrites=true&w=majority
    
    0 讨论(0)
  • just remove the angel brackets from both side of your password

    const db = 'mongodb+srv://username:<password>@cluster0-re3gq.mongodb.net/test?retryWrites=true'------->wrong

    const db = 'mongodb+srv://username:password@cluster0-re3gq.mongodb.net/test?retryWrites=true'------>correct

    0 讨论(0)
  • 2020-12-29 03:06

    I think you're confused with the mongodb account password and user password. You should use user password, not account password. That was the reason of my case.

    0 讨论(0)
  • 2020-12-29 03:06

    I had the same problem, and in my case, the answer was as simple as removing the angle brackets "<"and ">" around <password>. I had been trying: my_login_id:<my_password>, when it should have been my_login_id:my_password.

    0 讨论(0)
提交回复
热议问题