Authentication failed.’ on server 192.168.29.128:27017. The full response is { “ok” : 0.0, “errmsg”
解释:由于mongodb中的admin库设置了认证的用户名和密码
db.auth('root','123')
如下:
spring.data.mongodb.username=root
spring.data.mongodb.password=123
# authentication :身份验证
spring.data.mongodb.authentication-database=admin
username和password无法对应上一开始认证的用户名和密码,此时就会提示认证错误