登陆认证两种方式,一种先登陆在认证:db.auth("xxx","xxx");
一种直接认证:mongo -u xxx -p xxx --authenticationDatabase xxx
第一种没有问题,可以认证成功,第二种报错: AuthenticationFailed: SCRAM-SHA-1 authentication failed, storedKey mismatch
求教怎么处理?
单机mongo,没有开启副本集,下边是配置:
systemLog:
destination: file
logAppend: true
path: /data/mongodb/logs/mongodb.log
storage:
dbPath: /data/mongodb/db
journal:
enabled: true
processManagement:
fork: true
pidFilePath: /data/mongodb/mongod.pid
net:
port: 27017
bindIp: 0.0.0.0
security:
authorization: enabled