Unable to load authentication plugin 'caching_sha2_password'.
에러:
Exception in thread "main" org.springframework.dao.DataAccessResourceFailureException: Error retrieving database meta-data; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Could not get Connection for extracting meta-data; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Cannot create PoolableConnectionFactory (Unable to load authentication plugin 'caching_sha2_password'.)
해결: 'caching_sha2_password'를 보는 순간, 예전에 블로그에 기록해두었던 에러로 기억이나서, 참고하여 해결함.
MySQL 8.x 부터는 인증 플러그인으로 caching_sha2_password 를 default로 사용한다.
해결방법으로, MySQL 5.x 처럼 mysql_native_password 방식을 default로 사용하게끔 변경해준다.
( mysql> ALTER USER '사용자'@'%' IDENTIFIED WITH mysql_native_password BY '비밀번호'; )
mysql> ALTER USER 'mywebuser'@'%' IDENTIFIED WITH mysql_native_password BY 'myweb123#';