Error Message: MongoError: bad auth Authentication failed through URI string
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
.
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.
It happens because your provided password in connection string is wrong and most probably you have mistaken cluster password with your login password, in simple words while connecting with Atlas Cluster we can't use our account password by which we login to the Atlas website. In both case we can reset our cluster password and solve this issue.
To Solve The Issue Follow Below Given Steps
Step 1:- Click Database Access From left Side Navigation of MongoDB Atlas page.
Step 2:- Select your username and and click on the edit button from right side.
Step 3:- Click to change password.
Step 4:- Click update user.
While changing password try to keep password only alphabetical because special characters need encoding.
that's all now you can connect.