Trouble Shooting

[MySQL 8.0 이상 에러] Authentication plugin 'caching_sha2_password'

yeit 2024. 1. 12. 19:57
728x90

 

Error

MySQL 8.0 버전부터는 사용자 인증 방식이 caching_sha2_password로 바뀌었다.

이로 인해 MySQL 클라이언트에서 해당 플러그인을 로드할 수 없을 때, 아래와 같은 에러가 발생한다.

[root@ was ~]# mysql -u testuser -h 10.10.X.X -p
Enter password: 
ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory

 

 

 

 

해결 방법

MySQL 서버에 접속하여 해당 계정의 인증 플러그인을 기존 인증 방식(mysql_native_password)으로 변경해주면 된다.

mysql> ALTER USER 'testuser'@'localhost' IDENTIFIED WITH mysql_native_password BY '비밀번호';

728x90