DBMS/MySQL

[MySQL] Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Client does not support authentication protocol requested by server; consider upgrading MySQL client 현상

antoroong 2025. 2. 17. 21:49

mysql의 비밀번호 알고리즘때문이다

나는 5.x 버전대의 소스인데

mysql 8.x 버전대로 jdbc연결을 하려고한다 .

 

이럴 경우

 

8.x버전대 mysql들어가사ㅓ

SELECT Host,User,plugin,authentication_string FROM mysql.user;

확인해보면 plugin 알고리즘이

caching_sha2_password인데

이것을 mysql_native_password 바꾸어 주면 된다

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '’asdasd’;

해주면

 

변경 성공

flush privileges; 까지해주면 커넥션 완료