Unable to load authentication plugin 'caching_sha2_password'
Unable to load authentication plugin 'caching_sha2_password'
MySQL 8.x를 설치하고 토드 에지를 통해 접속할려고 했더니 에러가 발생하였다.
8.x 부터는 변경사항이 꽤 있는 것 같다.
MySQL 8.x는 인증 플러그인으로 caching_sha2_password 를 default로 사용한다.
MySQL 5.x는 mysql_native_password 방식을 default로 사용하여 caching_sha2_password 방식으로 사용이 불가할 것 같다. (지원여부는 정확히 모르겠으나, 기본 설치시에는 지원하지 않는다. 플러그인을 추가할 수 있는지 여부는 모르겠다.)
그래서 MySQL에 연결하고자 할 때 문제가 위와 같은 문제가 발생하게 된다.
문제를 해결하는 방법은
1) 사용자에 대해서 password 방식을 mysql_native_password 방식으로 변경한다.
mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
2) my.cnf 또는 my.ini 수정
default_authentication_plugin=caching_sha2_password
부분을
default_authentication_plugin=mysql_native_password 로 수정하고 재부팅을 한다.
3) toad edge의 경우 최신버전을 설치하고 driver를 최신으로 맞춰주니 잘 되었다.
4) 이클립스의 경우 MySQL driver를 최신으로 변경하여 연결을 시도해본다.
드라이버 다운로드 방법은 아래 URL 참고.
https://web-obj.tistory.com/320
MySQL 드라이버 다운로드
MySQL driver 다운로드 하는 방법 1. pom.xml (메이븐을 이용) mysql-connector-java 부분에 <version5.1.31< version=""> 와 같이 버전이 기입되어 있는데, 다운받고자 하는 버전으로 수정한다. 1) 버전은 설치되어..</version5.1.31<>
web-obj.tistory.com
드라이버를 변경하면 연결하는 방법도 약간 바뀌어야 한다. 아래 URL 참고.
https://web-obj.tistory.com/319
'com.mysql.jdbc.Driver'. This is deprecated
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver cla..
web-obj.tistory.com