666

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?

Shadow
  • 33,525
  • 10
  • 51
  • 64
Aman Aggarwal
  • 17,619
  • 9
  • 53
  • 81
  • 4
    You might be able to fix this problem if you configure MySQL 8.0 to run in mysql_native_password mode. – Raymond Nijland Mar 09 '18 at 14:07
  • 10
    Correct, MySQL Workbench needs a connector update to be able work with cached sha2 passwords (coming soon). – Mike Lischke Mar 10 '18 at 18:47
  • 1
    @RaymondNijland how to configure that ? – Aman Aggarwal Mar 12 '18 at 04:42
  • 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 '18 at 18:33
  • @AmanAggarwal MySql Workbench has a new version, that is compatible with MySQL 8.0. It is RC but I don't take any exception, it is looking great =). – Salih KARAHAN Jun 30 '18 at 00:31
  • @MikeLischke As I just [read](https://forums.mysql.com/read.php?10,664655,664726#msg-664726) that caching_sha2_password is not available separately because it's statically linked in libmysql.dll. That's very ok in a major update, I only wonder why there is just a 64bit version of libmysql, but none for 32bit? Did Oracle really break with 32bit server systems? – Anse Jul 23 '18 at 19:24
  • 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. – Mike Lischke Jul 24 '18 at 06:46
  • There is just no download option for the 32bit version on mysql.com. If you say that's not right it may be possible I need to run the installer on a 32bit Windows to get it. Not sure where I get it otherwise. – Anse Jul 24 '18 at 13:00
  • Just tried installing on a 32bit Windows 7, then the [installer](https://cdn.mysql.com//Downloads/MySQLInstaller/mysql-installer-community-8.0.11.0.msi) says it only contains the 64bit server, not the 32bit version. – Anse Jul 25 '18 at 19:49
  • 3
    Those answers suggesting to use weaker encryption is not the right way. Use other clients like [tableplus](https://tableplus.io/). – ohkts11 Apr 28 '19 at 05:38
  • Will any answer just use the dang plugin. I must have seen native like 15 times!! 8.0.31 here, but dll on Windows. – Pysis Feb 10 '23 at 15:27
  • OpenJDK 17 disabled TLS 1.0 and 1.1. Only few tools are keeping up to date with latest Java releases. I tested (DbSchema)[https://dbschema.com] and is working fine. – DbSchema Jun 29 '23 at 17:48

38 Answers38

478

you can change the encryption of the password like this.

ALTER USER 'yourusername'@'localhost' IDENTIFIED WITH mysql_native_password BY 'youpassword';
Unamata Sanatarai
  • 6,475
  • 3
  • 29
  • 51
twocold
  • 4,859
  • 2
  • 10
  • 5
  • 78
    What if OP wants to use brand-new cool authentication method? – LibertyPaul Apr 21 '18 at 14:50
  • @twocold How do you "undo" the ALTER USER above back to MySQL 8.0 standard (new encryption level) once you've done that and it doesn't work? – Will Belden Nov 27 '18 at 20:53
  • @LibertyPaul what is this brand-new cool authentication method that is breaking everything? Got a link or a term I can google? – Brian FitzGerald Jan 25 '19 at 13:04
  • 3
    @BrianFitzGerald it's "caching_sha2_password", link [here](https://dev.mysql.com/doc/refman/8.0/en/caching-sha2-pluggable-authentication.html) or [here](https://mysqlserverteam.com/mysql-8-0-4-new-default-authentication-plugin-caching_sha2_password/). – Oliver Feb 19 '19 at 13:21
  • 1
    It worked. Thanks Man. ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'; – Vivek Garg Mar 20 '19 at 12:29
  • 2
    Someone else mentioned to add this `default_authentication_plugin=mysql_native_password` to the config but that didn't work for me. Using the ALTER statement worked. Thank you! :) – Carl Du Plessis Mar 19 '20 at 14:55
  • If it makes sense, you can consider creating a dedicated user for MySQL Workbench (with cryptic username and password and minimum permissions granted for the table), and use that to connect to the database with the tool. You can reduce the connectivity surface for using less secure authentication. When the workbench / MySQL installation starts supporting the newer authentication method, you can then happily delete this user. – FooF Jun 10 '20 at 14:44
  • 5
    I had to change localhost to "%". This allows root to be connected to remotely. ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'mypasswrd'; – Jack BeNimble Nov 10 '20 at 04:17
  • This is a good approach for other clients since they may not support the new authentication method from MySQL 8. – d70rr3s Nov 14 '20 at 10:11
  • I've done this with multiple users on multiple server setups that use older PHP that doesn't support the new mechanism and for some reason this one server now just refuses to accept the user with native password. I had to set the default_authentication_plugin in the server globally. – coladict Aug 06 '21 at 08:58
372

Note: For MAC OS

  1. Open MySQL from System Preferences > Initialize Database >
  2. Type your new password.
  3. Choose 'Use legacy password'
  4. Start the Server again.
  5. Now connect the MySQL Workbench

Image description

alexander.polomodov
  • 5,396
  • 14
  • 39
  • 46
Santhosh Sivan
  • 3,785
  • 2
  • 6
  • 2
  • 4
    This work, thanks. I think it works because MySQL workbench uses legacy password encryption to connect to the DB server. Can also be done while installing MySQL and choosing the Legacy encryption, instead of the recommended Strong password encryption. – monkSinha May 07 '18 at 05:53
  • 2
    Some version's mysql have a different setting pannel and this can't works – Michael Yang Jun 01 '18 at 03:05
  • 13
    Advertising to go back to old and less secure authentication is *not* a good solution at all. – Mike Lischke Jun 13 '18 at 06:16
  • 87
    I don't have MySQL in System Preferences – JavaRunner Jul 23 '18 at 03:44
  • You can set up MySQL in your System Preferences by following this: https://dev.mysql.com/doc/refman/5.7/en/osx-installation-prefpane.html – Sam Houston Sep 14 '18 at 13:27
  • Thanks for the hint! I would have never figured this one out without spending a whole lot of time on it. :) – DigiOz Multimedia Nov 16 '19 at 20:17
  • 2
    Any development on this front? Is it possible now at the end of 2020 to use MariaDb to connect to MySQL without using legacy security? – jpinelo Nov 10 '20 at 13:44
  • So, this is probably my own dumb fault for not reading/believing the fine print but I tried this solution and not only did it not work but it wiped out the data in my instance: "If a data directory already exists, it will be deleted" – Richard W Dec 15 '20 at 22:04
  • @JavaRunner I just installed MySQL and it wouldn't show up. Restart the Mac and it will be available. – Lauk-k Oct 18 '21 at 11:25
163

For Windows 10:

Open the command prompt:

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

Alternatively, you can change the my.ini configuration as the following:

[mysqld]

default_authentication_plugin=mysql_native_password

Restart the MySQL Server and open the Workbench again.

J. Scott Elblein
  • 4,013
  • 15
  • 58
  • 94
Araz Ghazaryan
  • 1,695
  • 1
  • 10
  • 5
126

I had the same problem, but the answer by Aman Aggarwal didn't work for me with a Docker container running mysql 8.X. I loged in the container

docker exec -it CONTAINER_ID bash

then log into mysql as root

mysql --user=root --password

Enter the password for root (Default is 'root') Finally Run:

ALTER USER 'username' IDENTIFIED WITH mysql_native_password BY 'password';

You're all set.

Zach Smith
  • 8,458
  • 13
  • 59
  • 133
axelferreira
  • 1,990
  • 1
  • 12
  • 10
  • This looks like it could be a good answer for what i'm looking for. But I don't know what "this" is. do you mean the accepted answer? or another one... – Zach Smith Jul 02 '18 at 02:46
  • 2
    Yes @ZachSmith, "this" referes to the accepted answerer. – axelferreira Jul 03 '18 at 09:02
  • 3
    How about `docker exec -it CONTAINER_ID mysql --user=root --password` instead of two commands that rely on the presence of the `bash` shell (which is not certain in the future)? – Eric Aug 22 '18 at 09:37
  • This didn't work with sequelpro 1.1.2 using docker desktop 2.0.3.0 (mac). the commands all work, but sequel pro errors on login - using mysql:latest (v8.0.15) – arcseldon Mar 19 '19 at 06:53
  • As others have reported, using mysql 5.7 works with nothing required: `docker run -p 3306:3306 --name mysql1 -e MYSQL_ROOT_PASSWORD=secret -d mysql:5.7` – arcseldon Mar 19 '19 at 07:05
  • Lots of history with this issue - https://github.com/sequelpro/sequelpro/issues/2699 – arcseldon Mar 19 '19 at 07:11
  • this solved my problem but the next day it apeared again. i don't know why but if i close the db and restart it i need to alter the user again... – Panagiss Dec 04 '20 at 17:35
87

You can change the encryption of the user's password by altering the user with below Alter command :

ALTER USER 'username'@'ip_address' IDENTIFIED WITH mysql_native_password BY 'password';

OR

We can avoid this error by make it work with old password plugin:

First change the authentication plugin in my.cnf file for Linux / my.ini file in Windows:

[mysqld]

default_authentication_plugin=mysql_native_password

Restart the mysql server to take the changes in affect and try connecting via MySQL with any mysql client.

If still unable to connect and getting the below error:

Unable to load plugin 'caching_sha2_password'

It means your user needs the above plugin. So try creating new user with create user or grant command after changing default plugin. then new user need the native plugin and you will able to connect MySQL.

Thanks

Aman Aggarwal
  • 17,619
  • 9
  • 53
  • 81
81

Ok, wasted a lot of time on this so here is a summary as of 19 March 2019

If you are specifically trying to use a Docker image with MySql 8+, and then use SequelPro to access your database(s) running on that docker container, you are out of luck.

See the sequelpro issue 2699

My setup is sequelpro 1.1.2 using docker desktop 2.0.3.0 (mac - mojave), and tried using mysql:latest (v8.0.15).

As others have reported, using mysql 5.7 works with nothing required:

docker run -p 3306:3306 --name mysql1 -e MYSQL_ROOT_PASSWORD=secret -d mysql:5.7

Of course, it is possible to use MySql 8+ on docker, and in that situation (if needed), other answers provided here for caching_sha2_password type issues do work. But sequelpro is a NO GO with MySql 8+

Finally, I abandoned sequelpro (a trusted friend from back in 2013-2014) and instead installed DBeaver. Everything worked out of the box. For docker, I used:

docker run -p 3306:3306 --name mysql1 -e MYSQL_ROOT_PASSWORD=secret -d mysql:latest --default-authentication-plugin=mysql_native_password

You can quickly peek at the mysql databases using:

docker exec -it mysql1 bash

mysql -u root -p

show databases;
arcseldon
  • 35,523
  • 17
  • 121
  • 125
  • 1
    Thanks a lot for sharing this. I was trying the exact same combo after accidentally deleting my MySQL dev container. – martn_st Mar 19 '19 at 21:19
  • 1
    Very sad that Sequel Pro does not actively developing anymore :( Latest news dated for 3 Apr 2016, while it is 2019 already. It was a best tool I've seen for MySQL explorer. – Oleksii Shnyra Apr 20 '19 at 09:29
  • @OleksiiShnyra true there hasn't been a production release for a few years, but FYI, newer "nightly" releases are available. https://sequelpro.com/test-builds and via `brew cask install homebrew/cask-versions/sequel-pro-nightly`. – Peter W May 08 '19 at 07:30
  • There's a workaround that may get SequelPro working, for those able to log in via the command line (`mysql` client) and `ALTER` their myslq.user table, noted here: https://github.com/sequelpro/sequelpro/issues/3037#issuecomment-435841088 – Peter W May 08 '19 at 07:32
  • If you are on MySQL 8 and don't want to downgrade to `mysql_native_password`, you can follow this: https://stackoverflow.com/a/56402217/2321594 – Aidin May 31 '19 at 22:22
  • @PeterW SequelAce is a fork of SequelPro and being actively maintained: https://github.com/Sequel-Ace/Sequel-Ace – Tim Aug 03 '22 at 11:57
76

Currently (on 2018/04/23), you need to download a development release. The GA ones do not work.

I was not able to connect with the latest GA version (6.3.10).

It worked with mysql-workbench-community-8.0.11-rc-winx64.msi (from https://dev.mysql.com/downloads/workbench/, tab Development Releases).

Montecarlo
  • 1,239
  • 1
  • 11
  • 24
  • 7
    This is in fact the right answer: MySQL 8.0 requires MySQL Workbench 8.0, which unfortunately looks still in beta mode. But once installed you may stick with the new SHA password encryption, no need to change anything. – Cristian Scutaru Jun 07 '18 at 16:43
  • 1
    Not a beta but a release candidate (RC). GA (generally available) version is coming soon. – Mike Lischke Jun 13 '18 at 06:17
  • The best idea for me. – Wojciech Fornal Jul 09 '18 at 07:51
  • 2
    This is still the case. Installation of the GA version still results in an inability to login using the recommended password encryption. There is no warning that the GA version works with only the legacy authentication. – Donald Rich Jul 09 '18 at 10:59
  • 2
    At least in MacOS, the GA version is currently 8.0.12 (2018/08/13) and solves the issue! Thanks! – Bruno Silvano Aug 13 '18 at 20:07
64

Note: For Linux (Debian, Ubuntu, Mint)

I got this error:

MySQL Error Message: 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 solved it with these steps:

  1. Enter on mysql console: $ mysql -u root -p, if you don't have a password for root user, then:

  2. Use mysql db: mysql> use mysql;

  3. Alter your user for solve the problem: mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

  4. Exit... mysql> quit;

  5. Done!

Sajad Torkamani
  • 544
  • 1
  • 7
  • 18
Caio Ladislau
  • 1,257
  • 13
  • 25
60

I was installing MySQL on my Windows 10 PC using "MySQL Web Installer" and was facing the same issue while trying to connect using MySQL workbench. I fixed the issue by reconfiguring the server form the Installer window.

MySQL Web Installer - Home Screen

Clicking on the "Reconfigure" option it will allow to reconfigure the server. Click on "Next" until you reach "Authentication Method".

MySQL Installer - Authentication Method

Once on this tab, use the second option "Use Legacy Authentication Method (Retain MySQL 5.x Compatibility)".

Keep everything else as is and that is how I solved my issue.

ImtiazeA
  • 1,272
  • 14
  • 19
  • 1
    I manually unzip mysql-8.0.11-winx64.zip and cannot easily solve "caching_sha2_password cannot be loaded" problem. However using mysql-installer-community-8.0.11.0.msi and I follow above recommendation, MySQL Workbench 8.0.11 can login MySQL server 8.0.11. – oraclesoon Jun 29 '18 at 09:58
  • Did this. Still have the problem – gotube Aug 10 '22 at 21:52
42

like this?

docker run -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -d mysql --default-authentication-plugin=mysql_native_password
mysql -uroot --protocol tcp

Try in PWD

https://github.com/GitHub30/docs/blob/change-default_authentication_plugin/mysql/stack.yml

or You shoud use MySQL Workbench 8.0.11.

井上智文
  • 1,905
  • 17
  • 14
23

For Windows 10,

  1. Modify my.ini file in C:\ProgramData\MySQL\MySQL Server 8.0\

    [mysqld]
    default_authentication_plugin=mysql_native_password
    
  2. Restart the MySQL Service.

  3. Login to MySQL on the command line, and execute the following commands in MySQL:

    • Create a new user.

      CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
      
    • Grant all privileges.

      GRANT ALL PRIVILEGES ON * .* TO 'user'@'localhost';
      
  4. Open MySQL workbench, and open a new connection using the new user credentials.

I was facing the same issue and this worked.

Michael
  • 8,362
  • 6
  • 61
  • 88
Preetham
  • 397
  • 1
  • 10
22
  • Open MySQL Command Line Client

  • Create a new user with a new pass

Considering an example of a path to a bin folder on top, here's the code you need to run in the command prompt, line by line:

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';
  • Then, you can access Workbench again (you should be able to do that after creating a new localhost connection and using the new credentials to start using the program).

Set up a new local host connection with the user name mentioned above (native user), login using the password (new_password)

Image

Courtesy: UDEMY FAQs answered by Career365 Team

J. Scott Elblein
  • 4,013
  • 15
  • 58
  • 94
Ahmed Ziyad
  • 221
  • 1
  • 5
  • This worked. Why? I got this error when trying to connect with `root` and no password, which worked in the command line, but not in `Sequel Pro`. – Volte Dec 31 '18 at 23:50
  • work like charm, full corelation with Thread Start question and please note : your must have Mac os Catalina, docker 19.03, mysql latest images, exection this command $docker run -p 3306:3306 -d --name mysql -e MYSQL_ROOT_PASSWORD=password mysql/mysql-server from dzone website. – banzai May 24 '20 at 11:55
22

Although this shouldn't be a real solution, it does work locally if you are stuck

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';
elad silver
  • 9,222
  • 4
  • 43
  • 67
17

This is my databdase definition in my docker-compose:

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"

The relevant line there is entrypoint.

After build and up it, you can test it with:

$ 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 |
+---+
16

If you still want to use the new authentication method, the proper solution is to install the mariadb-connector-c package. For Alpine, run:

apk add mariadb-connector-c

This will add the missing caching_sha2_password.so library into /usr/lib/mariadb/plugin/caching_sha2_password.so.

keyblade95
  • 329
  • 3
  • 11
  • This is the actual solution and should be the accepted answer. By the way, on macOS it's as simple as `brew install mariadb-connector-c`. – Erik Pöhler Nov 09 '22 at 08:53
13

For those using Docker or Docker Compose, I experienced this error because I didn't set my MySQL image version. Docker will automatically attempt to get the latest version which is 8.

I set MySQL to 5.7 and rebuilt the image and it worked as normal:

version: '2'
services: 
  db:
   image: mysql:5.7
Dylan Pierce
  • 4,313
  • 3
  • 35
  • 45
10

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

Darrell Duane
  • 3,874
  • 1
  • 18
  • 9
  • This worked for me on Centos 7. For some reason, my passwords were saved as caching_sha2_password by default and I was getting error #1251 when trying to log in with phpMyAdmin. – DaFudgeWizzad Jun 21 '19 at 14:39
9

Here is the solution which worked for me after MySQL 8.0 Installation on Windows 10.

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'

Pratik Patil
  • 3,662
  • 3
  • 31
  • 31
8

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!)
Bruno Casali
  • 1,339
  • 2
  • 17
  • 32
6

Open my sql command promt:

step 1

then enter mysql password

step 2

finally use:

ALTER USER 'username'@'ip_address' IDENTIFIED WITH mysql_native_password BY 'password';

refer:https://stackoverflow.com/a/49228443/6097074

Thanks.

ankit
  • 2,591
  • 2
  • 29
  • 54
6

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.

alberto56
  • 2,997
  • 3
  • 28
  • 47
6

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

Shammoo
  • 1,084
  • 10
  • 22
5

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';
Vikky
  • 1,123
  • 14
  • 16
5

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:

  1. sudo apt-get update
  2. sudo apt-get install lsb-release -y
  3. Download a Debian package which update apt sources for you from the MySQL web site.
  4. sudo dpkg -i mysql-apt-config_0.8.13-1_all.deb and select the options you want. In my case I only need MySQL Tools & Connectors to be enabled.
  5. sudo apt-get update
  6. sudo apt-get install mysql-client -y
  7. Done. You can now run the new MySQL client and connect with the new authentication method.
huggie
  • 17,587
  • 27
  • 82
  • 139
4

MySQLWorkbench 8.0.11 for macOS addresses this. I can establish connection with root password protected mysql instance running in docker.

  • This is what fixed it for me. I was running an older MySQL Workbench 6.3 with a 8.0 server. While many answers here say to downgrade server compatibility, I simply upgraded my Workbench version to the latest 8.0 release (currently 8.0.15). – Sum None Mar 16 '19 at 22:19
3

The below solution worked for me enter image description here

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

enter image description here

3

Actually MySql allows two type of authentication at the time of installation.

  1. Password Encryption
  2. Legacy Encryption

enter image description here

Read Here

So by checking legacy authentication the issue was resolved.

TAHA SULTAN TEMURI
  • 4,031
  • 2
  • 40
  • 66
1

Try using legacy password while downloading and installing MySql, that helped me. Or follow the method posted by Santhosh Shivan for Mac OS.

1

Just downloaded the latest mysqlworkbench which is compatible with the latest encryption:

https://downloads.mysql.com/archives/workbench/

Note: On Mac big Sur, the latest two versions: 8.0.22 and 8.0.23 are buggy and do not work.

Use 8.0.21 until these are fixed

Anon
  • 1,307
  • 2
  • 20
  • 30
1

I run docker in M1 (arm64), the direct way of changing in the docker bash does not work for me. Instead, I change the mysql image to be mysql:8.0.26 and the platform is set as linux/x86_64 and add default_authentication_plugin=mysql_native_password to my.cnf Then, you rebuild your container.

htlbydgod
  • 330
  • 2
  • 8
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
Daniel Adigun
  • 259
  • 1
  • 10
0

pip uninstall mysql-connector

and then install pip install mysql-connector-python

Animesh Nayak
  • 97
  • 1
  • 2
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.

Paul Waldo
  • 1,131
  • 10
  • 26
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.

user1012513
  • 2,089
  • 17
  • 14
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]

Ahsan Horani
  • 239
  • 2
  • 13
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/

Laloi
  • 506
  • 1
  • 4
  • 12
-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!

nickitalyano
  • 111
  • 5