Tag Archives: java.sql.SQLException: Unable to load authentication plugin ‘caching_sha2_password‘.

java.sql.SQLException: Unable to load authentication plugin ‘caching_sha2_password‘

Problem Description:

today, I encountered a problem with the database version, which was mysql5.6. When I upgraded to 8.0, I reported an error when I connected to the database:

Unable to load authentication plugin ‘caching_ sha2_ password’.


Solution:

The online solution is to modify the database password encryption method, which is not recommended

There are two changes:
1, modify the version of MySQL connector Java in pom.xml to 8. X.xx

2, and modify the database connection configuration file in the project to com. Mysql. CJ. JDBC. Driver