I can't connect with mongodb

28

I’m trying to connect to my cluster on mongoDB Atlas via Mongoose.connect(), but every time i try to connect i get an exception “MongoError: authentication fail”
“mongodb+srv://ahemddoha:@cluster0.0jwhkdk.mongodb.net/Socialmedia?retryWrites=true&w=majority”
I checked all connection and it works and the code error in the connection with altas

If that’s really your connection string, you have not provided a password.
The password comes between the : and the @

1 Like

And BTW, is it possible you misspelled your user id? I infer that your personal name is “Ahmed” but your user id is spelled “ahemddoha” which makes me wonder if your user id is really “ahmeddoha”.

1 Like