본문 바로가기
DB/Mysql

Mysql Unable to load authentication plugin 'caching_sha2_password'.

by 애플 로그 2022. 5. 13.
반응형

Mysql Unable to load authentication plugin 'caching_sha2_password'.

mysql 8.0을 설치하고 root 계정으로 접속시에 위와같은 에러가 발생한다. 

mysql 8.0의 기본 인증 플로그인은 "caching_sha2_password"이다. 이를 사용하려면 SSL 보안연결이나 RSA 보안을 적용한 비암호 연결을 사용해야 한다는것이고, 그래서 에러가 발생하는것이다.

 

[해결방법]

"caching_sha2_password" -> "mysql_native_password " 으로 암호 인증 방식을 변경하면된다.

즉, 기존에 흔히 알고있는 비밀번호 입력 방식  으로 변경 해서 사용하면 된다.

1. Mysql server 설치 폴더로 이동

C:\Program Files\MySQL\MySQL Server 8.0\bin>mysql -u root -p

 

Enter password: ***********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 21
Server version: 8.0.29 MySQL Community Server - GPL

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

mySQL 에 접속 되었다면 

 

2.  mysql DB 사용

mysql> use mysql

 

3. mysql_native_password 변경 명령어

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

 

4. 변경사항 저장 

mysql> flush privileges;

 

댓글