[Solved] MongoDB Error: FaileError: dToParse: Password must be URL Encoded for mongodb:// URL:

Mongodb – error failedtoparse: password must be URL encoded for mongodb:// URL:

Problem background:
when you log in to mongodb with @ password, an error is reported. Failedtoparse: password must be URL encoded for mongodb:// URL:

Problem analysis:
official: https://docs.mongodb.com/manual/reference/connection-string/#examples

If the username or password includes the following characters:

@ is %40

Solution:
we can replace the login password @ with %40.

After creating an Iam ordinary user, you can execute the following commands to log in to mongodb through the Iam user:

$ mongo --quiet mongodb://iam:'aaa%40intah'@127.0.0.1:27017/iam_analytics?authSource=iam_analytics

Read More: