最近做一个基于ABP的.net Core的项目,数据库选了MongoDB,但是返现无法给数据库设置认证,只要设置了账号密码连接就报错
连接串如下:
mongodb://root:rootpassword@192.168.100.1/Webdev
已经给了root用户"__system"角色,使用Robo3T登录一切正常。但是代码就是报错
An unhandled exception occurred while processing the request. MongoCommandException: Command saslStart failed: Authentication failed.. MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol<TCommandResult>.ProcessReply(ConnectionId connectionId, ReplyMessage<RawBsonDocument> reply) MongoAuthenticationException: Unable to authenticate using sasl protocol mechanism SCRAM-SHA-1. MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelper(CancellationToken cancellationToken)
mongo是用的docker,刚开始以为是版本问题,找了个低版本的,问题依旧。各种查,baidu、bing、群里问折腾了N久。因为用的是直接基于ABP的.Net Core官方的项目,做开发