-
navicat 创建monogdb库 名称为 hzd
-
spring boot 连接hzd 报错
org.springframework.data.mongodb.UncategorizedMongoDbException: Exception authenticating MongoCredential{mechanism=SCRAM-SHA-1, userName='root', source='hzd', password=<hidden>, mechanismProperties=<hidden>}
;
创建集合后,需要账号,密码,并赋予读写权限
db.createUser({user: "root",pwd: "XXXXXXXX",roles: [ { role: "readWrite", db: "hzd" } ]} )