The connection string contains invalid user information. If the username or password contains a colon (:) or an at-sign (@) then it must be urlencoded 解决方法

 错误 原因连接mongoDB 的url 中 用户名 或密码出现了 @  或   : 符号

url 中原本就带有 @ 和 : 用户名 或密码  再出现 这两个字符时就无法区分哪个是真正的分隔符

解决办法:

对@使用16进制进行URL编码:%40

对:使用16进制进行URL编码:%3A

用上面16进制的URL编码代替原本的字符就行了。

原文地址:https://www.cnblogs.com/feathe/p/9923974.html