华为云 mongodb 4.0.3 报无法使用sasl协议机制SCRAM-SHA-256进行身份验证 问题解决访问

 

 

华为云 mongodb 4.0.3 mongodb diver 2.12.4 c# 代码连接,连接字符串密码包含%,因阿里云控制台提示修改密码可以包含:特殊字符% #

但代码连接会报: Unable to authenticate using sasl protocol mechanism SCRAM-SHA-256. 无法使用sasl协议机制SCRAM-SHA-256进行身份验证 这个信息

MongodbConnectString": "mongodb://rwuser:7Jb322OwB#Wk6%C@ip:8635",

 

navicat p 客户端连接mongodb不会报这个错误

 

 

删除集合的脚本:
use("colltest");
db.getCollectionNames().forEach(function(ColName){
var re1=new RegExp(".*_BizLog$");
var re2=new RegExp(".*_Listing$");
if(!re1.test(ColName)&&!re2.test(ColName))
{
return;
}

print(db[ColName]);
});

 

1、删除colltest库下以"_BizLog."和“_Listing.”开头的集合

M_Express_Listing_BizLog
Ap_Publish_Wish_Listing

posted @ 2022-01-15 14:06  大树2  阅读(1883)  评论(0)    收藏  举报