美文网首页
mgo.v2无法连接MongoDB 5.0.1

mgo.v2无法连接MongoDB 5.0.1

作者: 岑吾 | 来源:发表于2021-09-04 13:43 被阅读0次

    MongoDB升级到5.0.1之后,使用gopkg.in/mgo.v2来连接MongoDB数据库时,发现验证时出现验证错误了。server returned error on SASL authentication step: BSON field 'saslContinue.mechanism' is an unknown field.
    MongoDB 5 支持SCRAM-SHA-1和SCRAM-SHA-256验证,mgo.v2默认是用SCRAM-SHA-1验证的,换个authMechanism=SCRAM-SHA-256验证后,就报出个另一个错误SASL support not enabled during build (-tags sasl)
    在全网搜了一天,也没有找到这个问题的决绝办法,在考虑是不是要不要换个MongoDB驱动呢

    相关文章

      网友评论

          本文标题:mgo.v2无法连接MongoDB 5.0.1

          本文链接:https://www.haomeiwen.com/subject/flvkwltx.html