671

I am connecting MySQL - 8.0 with MySQL Workbench and getting the below error:

Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/mysql/lib/plugin/caching_sha2_password.so, 2): image not found

I have tried with other client tool as well.

Any solution for this?

12
  • 4
    You might be able to fix this problem if you configure MySQL 8.0 to run in mysql_native_password mode. Mar 9, 2018 at 14:07
  • 10
    Correct, MySQL Workbench needs a connector update to be able work with cached sha2 passwords (coming soon). Mar 10, 2018 at 18:47
  • 9
    I set default login to native and restarted, the problem persists and I cannot login to create a new user. Surprising that in 2018 an install Mysql and workbench does not run out the box. Shoddy quality control.
    – ChrisR
    May 29, 2018 at 18:33
  • 2
    I don't know where you got the impression from there wouldn't be a 32bit mysql client lib anymore, but that's not true. What is true is that MySQL Workbench no longer comes with a 32bit version. Jul 24, 2018 at 6:46
  • 3
    Those answers suggesting to use weaker encryption is not the right way. Use other clients like tableplus.
    – toshi
    Apr 28, 2019 at 5:38

38 Answers 38

1
2
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
0

pip uninstall mysql-connector

and then install pip install mysql-connector-python

0

I was getting the error 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. It turns out it was my own fault; I had mistyped the user name. Once I corrected the typo, I could connect just fine.

0

In Debian 11, I had mariadb-client-10.3 MySQL client, and I had the following error:

ERROR 1045 (28000): Plugin caching_sha2_password could not be loaded: /usr/lib/x86_64-linux-gnu/mariadb19/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory

I fixed the issue by upgrading my system.

0

For docker-compose.yml, add this line inside your DB service

command: "--max_allowed_packet=256M && --default-authentication-plugin=mysql_native_password"

This will set mysql_native_password as your default auth plugin. And also will upgrade max_allowed_packet [optional]

0

To access mysql using mysql_native_password from other BE container one should use "root"@"%" instead of root@localhost and build again your backend container it should work.

 ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'mypasswrd'
-3

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/

-5

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!

1
2

Not the answer you're looking for? Browse other questions tagged or ask your own question.