链接Mongodb报错Unable to authenticate using sasl protocol mechanism SCRAM-SHA-1

解决方案

在连接数据库字符串后面添加 authSource=admin


image.png
"MongoDB": {
"Host": "mongodb://touchadmin:[email protected]:27017/TouchAdmin?authSource=admin",
"DbName": "TouchAdmin"
}
image.png
use TouchAdmin
db.createUser(
{
    user:"touchadmin",
    pwd:"touchadmin",
    roles:[
        {role:"dbOwner", db:"TouchAdmin"}
    ]
}
)

你可能感兴趣的:(链接Mongodb报错Unable to authenticate using sasl protocol mechanism SCRAM-SHA-1)