链接Mongodb报错Unable to authenticate using sasl protocol mechanism SCRAM-SHA-1
解决方案
在连接数据库字符串后面添加 authSource=admin
"MongoDB": { "Host": "mongodb://touchadmin:touchadmin123@127.0.0.1:27017/TouchAdmin?authSource=admin", "DbName": "TouchAdmin" }
use TouchAdmin db.createUser( { user:"touchadmin", pwd:"touchadmin", roles:[ {role:"dbOwner", db:"TouchAdmin"} ] }
作者:醉酒的姑娘
链接:https://www.jianshu.com/p/49422d79d55d
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。