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

前端 未结 15 1881
终归单人心
终归单人心 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:45

    Checklist to follow:

    1) Make sure you're using the correct password (the DB user password and not the Mongo account).

    2) When entering your password, make sure all special characters are URL encoded (for example: p@ssword should be p%40ssword).

    3) If you don't remember your password of your DB user - go to Database Access (if you're using Mongo Atlas) -> select your DB user -> edit -> create a new password -> don't forget update to click on 'Update User'.

    (!) Security warning: Do not write the password in plain text inside your code - Follow the suggestions given here.

提交回复
热议问题