인증 플러그인 'caching_sha2_password'를로드 할 수 없습니다
MySQL-8.0을 MySQL Workbench와 연결하고 아래 오류가 발생합니다.
인증 플러그인 'caching_sha2_password'를로드 할 수 없습니다 : dlopen (/usr/local/mysql/lib/plugin/caching_sha2_password.so, 2) : 이미지를 찾을 수 없습니다
다른 클라이언트 도구를 사용해 보았습니다.
이것에 대한 해결책?
참고 : MAC OS의 경우
- 시스템 환경 설정> 데이터베이스 초기화>에서 MySQL을 엽니 다.
- 새 비밀번호를 입력하십시오.
- '레거시 비밀번호 사용'을 선택하십시오.
- 서버를 다시 시작하십시오.
- 이제 MySQL Workbench를 연결하십시오

이와 같이 비밀번호의 암호화를 변경할 수 있습니다.
ALTER USER 'yourusername'@'localhost' IDENTIFIED WITH mysql_native_password BY 'youpassword';
Windows 10의 경우 : 명령 프롬프트를여십시오.
cd "C:\Program Files\MySQL\MySQL Server 8.0\bin"
C:\Program Files\MySQL\MySQL Server 8.0\bin> mysql -u root -p
Enter password: *********
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'newrootpassword';
Query OK, 0 rows affected (0.10 sec)
mysql> exit
또는 다음과 같이 my.ini 구성을 변경할 수 있습니다 .
[mysqld]
default_authentication_plugin = mysql_native_password
MySQL 서버를 다시 시작하고 Workbench를 다시여십시오.
아래의 Alter 명령으로 사용자를 변경하여 사용자 비밀번호의 암호화를 변경할 수 있습니다.
ALTER USER 'username'@ 'ip_address'mysql_native_password로 식별 됨 'password';
또는
이전 비밀번호 플러그인과 함께 작동하면이 오류를 피할 수 있습니다.
먼저 Windows의 Linux / my.ini 파일에 대한 my.cnf 파일 의 인증 플러그인을 변경하십시오 .
[mysqld]
default_authentication_plugin = mysql_native_password
변경 사항을 적용하기 위해 mysql 서버를 다시 시작하고 MySQL을 통해 mysql 클라이언트와 연결을 시도하십시오.
여전히 연결할 수없고 아래 오류가 발생하는 경우 :
Unable to load plugin 'caching_sha2_password'
사용자에게 위의 플러그인이 필요하다는 의미입니다. 따라서 기본 플러그인을 변경 한 후 create user 또는 grant 명령으로 새 사용자를 작성하십시오. 새 사용자에게는 기본 플러그인이 필요하며 MySQL을 연결할 수 있습니다.
감사
현재 (2018/04/23에) 개발 릴리스 를 다운로드해야합니다 . GA의 사람들은 작동하지 않습니다.
최신 GA 버전 (6.3.10)에 연결할 수 없습니다.
그것은 함께 일한 mysql-workbench-community-8.0.11-rc-winx64.msi(에서 https://dev.mysql.com/downloads/workbench/ 탭, 개발 자료 ).
나는 같은 문제가 있었지만 Aman Aggarwal의 대답은 mysql 8.X를 실행하는 Docker 컨테이너에서 작동하지 않았습니다. 컨테이너에 로그인했습니다
docker exec -it CONTAINER_ID bash
그런 다음 루트로 mysql에 로그인하십시오.
mysql --user=root --password
root의 비밀번호를 입력하십시오 (기본값은 'root'입니다). 마지막으로 다음을 실행하십시오.
ALTER USER 'username' IDENTIFIED WITH mysql_native_password BY 'password';
모두 준비되었습니다.
" MySQL Web Installer "를 사용하여 Windows 10 PC에 MySQL을 설치 하고 MySQL Workbench를 사용하여 연결하는 동안 동일한 문제가 발생했습니다. 설치 프로그램 창에서 서버를 재구성하여 문제를 해결했습니다.
"재구성"옵션을 클릭하면 서버를 재구성 할 수 있습니다. "인증 방법"에 도달 할 때까지 "다음"을 클릭하십시오.
이 탭에서 두 번째 옵션 인 "레거시 인증 방법 사용 (MySQL 5.x 호환성 유지)"을 사용하십시오.
다른 모든 것을 그대로 유지하면 문제가 해결됩니다.
이처럼?
docker run -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -d mysql --default-authentication-plugin=mysql_native_password
mysql -uroot --protocol tcp
https://github.com/GitHub30/docs/blob/change-default_authentication_plugin/mysql/stack.yml
또는 MySQL Workbench 8.0.11을 사용해야합니다.
자, 이것에 많은 시간을 낭비 했으므로 2019 년 3 월 19 일 현재 요약입니다.
MySql 8+ 와 함께 Docker 이미지를 사용하려고 시도한 다음 SequelPro 를 사용하여 해당 Docker 컨테이너에서 실행되는 데이터베이스에 액세스하는 경우 운이 좋지 않습니다.
내 설정은 docker desktop 2.0.3.0 (mac-mojave)을 사용하는 sequelpro 1.1.2이며 mysql : latest (v8.0.15)를 사용하여 시도했습니다.
다른 사람들이보고했듯이 mysql 5.7을 사용하면 아무것도 필요하지 않습니다.
docker run -p 3306:3306 --name mysql1 -e MYSQL_ROOT_PASSWORD=secret -d mysql:5.7
물론, Docker에서 MySql 8+를 사용할 수 있으며 해당 상황에서 (필요한 경우) 여기에 제공된 caching_sha2_password유형 문제에 대한 다른 답변 이 작동합니다. 그러나 sequelpro는 MySql 8 이상에서는 전혀 문제가되지 않습니다.
마지막으로 sequelpro (2013-2014에서 신뢰받는 친구)를 버리고 대신 DBeaver 를 설치 했습니다 . 모든 것이 즉시 작동했습니다. 도커의 경우 다음을 사용했습니다.
docker run -p 3306:3306 --name mysql1 -e MYSQL_ROOT_PASSWORD=secret -d mysql:latest --default-authentication-plugin=mysql_native_password
다음을 사용하여 mysql 데이터베이스를 빠르게 볼 수 있습니다.
docker exec -it mysql1 bash
mysql -u root -p
show databases;
-오픈 MySQL 명령 행 클라이언트
새로운 패스로 새로운 사용자 만들기
상단의 bin 폴더 경로의 예를 고려할 때 명령 프롬프트에서 한 줄씩 실행 해야하는 코드는 다음과 같습니다.
cd C:\Program Files\MySQL\MySQL Server 5.7\bin
MySQL -u root -p
current password...***
CREATE USER 'nativeuser'@'localhost'
IDENTIFIED WITH mysql_native_password BY 'new_password';
그런 다음 Workbench에 다시 액세스 할 수 있습니다 (새 로컬 호스트 연결을 작성하고 새 신임 정보를 사용하여 프로그램 사용을 시작한 후에이를 수행 할 수 있어야 함).
위에서 언급 한 사용자 이름 (기본 사용자)으로 새 로컬 호스트 연결을 설정하고 비밀번호 (new_password)를 사용하여 로그인하십시오.
예의 : Career365 팀이 답변 한 UDEMY FAQ
Docker 또는 Docker Compose를 사용하는 사람들은 MySQL 이미지 버전을 설정하지 않았기 때문에이 오류가 발생했습니다. Docker는 자동으로 최신 버전 인 8을 얻으려고 시도합니다.
MySQL을 5.7로 설정하고 이미지를 다시 빌드했으며 정상적으로 작동했습니다.
version: '2'
services:
db:
image: mysql:5.7
이것은 docker-compose의 내 databdase 정의입니다.
dataBase:
image: mysql:8.0
volumes:
- db_data:/var/lib/mysql
networks:
z-net:
ipv4_address: 172.26.0.2
restart: always
entrypoint: ['docker-entrypoint.sh', '--default-authentication-plugin=mysql_native_password']
environment:
MYSQL_ROOT_PASSWORD: supersecret
MYSQL_DATABASE: zdb
MYSQL_USER: zuser
MYSQL_PASSWORD: zpass
ports:
- "3333:3306"
해당 라인에 진입 점이 있습니다.
빌드 및 빌드 한 후 다음을 사용하여 테스트 할 수 있습니다.
$ mysql -u zuser -pzpass --host=172.26.0.2 zdb -e "select 1;"
Warning: Using a password on the command line interface can be insecure.
+---+
| 1 |
+---+
| 1 |
+---+
Windows 10의 경우
- ** C : \ ProgramData \ MySQL \ MySQL Server 8.0 **에서 my.ini 파일 수정
[mysqld] default_authentication_plugin = mysql_native_password
MySQL 서비스를 다시 시작하십시오.
명령 행에서 MySQL에 로그인하고 MySQL에서 다음 명령을 실행하십시오.
새로운 사용자 만들기
'password'로 식별 된 사용자 'user'@ 'localhost'를 작성하십시오.
- 모든 특권을 부여
모든 사용자에게 권한 부여 *. * 'user'@ 'localhost';
- MySQL 워크 벤치를 열고 새 사용자 자격 증명을 사용하여 새 연결을 엽니 다
나는 같은 문제에 직면하고 있었고 이것이 효과가 있었다.
다음은 Windows 10에서 MySQL 8.0을 설치 한 후 저에게 효과적이었습니다.
Suppose MySQL username is root and password is admin
Open command prompt and enter the following commands:
cd C:\Program Files\MySQL\MySQL Server 8.0\bin
mysql_upgrade -uroot -padmin
mysql -uroot -padmin
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'admin'
If you are getting this error on GitLab CI like me: Just change from latest to 5.7 version ;)
# .gitlab-ci.yml
rspec:
services:
# - mysql:latest (I'm using latest version and it causes error)
- mysql:5.7 #(then I've changed to this specific version and fix!)
Almost like answers above but may be in simple queries, I was getting this error in my spring boot application along with hibernate after MySQL upgrade. We created a new user by running the queries below against our DB. I believe this is a temp work around to use sha256_password instead of latest and good authentication caching_sha2_password.
CREATE USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'pa$$word';
GRANT ALL PRIVILEGES ON * .* TO 'username'@'localhost';
For me this started happening because on a project, I was using Docker image mysql:latest (which was version 5, and which was working fine), and during a later build, the latest version was switched to version 8, and stopped working. I changed my image to mysql:5 and I was no longer getting this error.
MySQLWorkbench 8.0.11 for macOS addresses this. I can establish connection with root password protected mysql instance running in docker.
Open my sql command promt:
then enter mysql password
finally use:
ALTER USER 'username'@'ip_address' IDENTIFIED WITH mysql_native_password BY 'password';
refer:https://stackoverflow.com/a/49228443/6097074
Thanks.
This error comes up when the tool being used is not compatible with MySQL8, try updating to the latest version of MySQL Workbench for MySQL8
The below solution worked for me 
Go to Mysql Workbench -> Server-> Users and Privileges 1.Click Add Account
2.Under Login Tab provide new details and make sure to choose the Authentication Type as standard and choose respective administrative roles and Schema Privileges
I found that
ALTER USER 'username'@'ip_address' IDENTIFIED WITH mysql_native_password BY 'password';
didn't work by itself. I also needed to set
[mysqld]
default_authentication_plugin=mysql_native_password
in /etc/mysql/mysql.conf.d/mysqld.cnf on Ubuntu 18.04 running PHP 7.0
Downloading a development release of 8.0.11-rc worked for me on a mac. with the following docker commands:
docker run --name mysql -p 3406:3306 -e MYSQL_ROOT_PASSWORD=mypassword -d mysql
If you are trying to connect to a MySQL server from a text-based MySQL client from another computer (be it Docker or not)
Most answers here involve connecting from a desktop client, or ask you to switch to an older authentication method. If you're connecting it with the MySQL client (text-based), I made it work with a Debian Buster in a Docker container.
Say you have the apt system and wget set up, do the following:
sudo apt-get updatesudo apt-get install lsb-release -y- Download a Debian package which update apt sources for you from the MySQL web site.
sudo dpkg -i mysql-apt-config_0.8.13-1_all.deband select the options you want. In my case I only needMySQL Tools & Connectorsto be enabled.sudo apt-get updatesudo apt-get install mysql-client -y- Done. You can now run the new MySQL client and connect with the new authentication method.
I solved this problem by installing MySQL 5.7:
Step 1 – Enable MySQL Repository
First of all, You need to enable MySQL 5.7 community release yum repository on your system. The rpm packages for yum repository configuration are available on MySQL official website. Use on of below command as per your operating system version.
On CentOS and RHEL 7
yum localinstall https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
On CentOS and RHEL 6
yum localinstall https://dev.mysql.com/get/mysql57-community-release-el6-9.noarch.rpm
On Fedora 27
dnf install https://dev.mysql.com/get/mysql57-community-release-fc27-9.noarch.rpm
On Fedora 26
dnf install https://dev.mysql.com/get/mysql57-community-release-fc26-9.noarch.rpm
On Fedora 25
dnf install https://dev.mysql.com/get/mysql57-community-release-fc25-9.noarch.rpm
Step 2 – Install MySQL 5.7 Server
As you have successfully enabled MySQL yum repository on your system. Now, install MySQL 5.7 community server using following commands as per your operating system version.
On CentOS and RHEL 7/6
yum install mysql-community-server
On Fedora 27/26/25
dnf install mysql-community-server
source: https://tecadmin.net/install-mysql-5-7-centos-rhel/
Rolling back to the previous installations (to MySQL Community Server 5.7 and Workbench 6.1)and setting up new MySQL credentials worked for me!
'development' 카테고리의 다른 글
| SaaS, PaaS 및 IaaS 란 무엇입니까? (0) | 2020.03.02 |
|---|---|
| Java에서 맵 값을 증가시키는 가장 효율적인 방법 (0) | 2020.03.02 |
| 안드로이드 버튼을 비활성화하는 방법? (0) | 2020.03.02 |
| JavaScript Date 객체에 시간을 추가 하시겠습니까? (0) | 2020.03.02 |
| Android에서 예 / 아니요 대화 상자를 표시하는 방법은 무엇입니까? (0) | 2020.03.02 |





