Because 3.0.3,mongodb joins the Scram-sha-1 checksum, a third-party tool is required to verify that a user authentication failure occurs when all spring boot is connected to MongoDB.
Workaround:
>Use Admin switched to DB admin>varSchema = Db.system.version.findOne ({"_id":"Authschema"}) > schema.currentversion =3 3>Db.system.version.save (Schema) Writeresult ({"nmatched":1,"nupserted":0,"nmodified":1})
Delete the original created user who already used the Scram-sha-1 authentication method
>Use Admin switched to DB admin>db.system.users.find () [...] { "_id":"Userdb.myuser","User":"MyUser","DB":"UserDB","Credentials": {"Scram-sha-1": {"IterationCount":10000,"Salt":"xxxxxxxxxxxxxxxxxxxxxxxx","Storedkey":"xxxxxxxxxxxxxxxxxxxxxxxxxxx","Serverkey":"xxxxxxxxxxxxxxxxxxxxxxxxxxx"} },"Roles": [ {"role":"Dbowner","DB":"UserDB"} ] }
>> Db.dropuser ("myuser"true >db.createuser ({User: ' MyUser ', pwd:'123456', Roles:[{role:'dbowner' , DB:'userdb'
Then shut down the server, turn on authentication, restart the server!!
More than 3.03 MongoDB permission validation issues for Spring boot connection