Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL 8.x - Plugin caching_sha2_password could not be loaded #5

Open
ysiivan opened this issue Feb 10, 2022 · 15 comments
Open

MySQL 8.x - Plugin caching_sha2_password could not be loaded #5

ysiivan opened this issue Feb 10, 2022 · 15 comments

Comments

@ysiivan
Copy link

ysiivan commented Feb 10, 2022

Getting

 / # mysql -h mysql-service 
ERROR 1045 (28000): Plugin caching_sha2_password could not be loaded: Error loading shared library /usr/lib/mariadb/plugin/caching_sha2_password.so: No such file or directory
@arey
Copy link
Owner

arey commented Feb 16, 2022

Do you solve your issue?
Do you have it with the published Docker image or by building yourself the Dockerfile of this repository?

@ysiivan
Copy link
Author

ysiivan commented Feb 17, 2022

I was using the published image. As far as I can tell the Alpine MySQL client package (assembled from MariaDB sources) is incomplete and is not compatible with a default MySQL 8.x install.
I had to use a whole MySQL 8 image for just the client part. Much larger, but it works.

@arey arey changed the title Plugin caching_sha2_password could not be loaded MySQL 8.x - Plugin caching_sha2_password could not be loaded Feb 18, 2022
@arey arey added the bug label Feb 18, 2022
@toussa
Copy link

toussa commented Jun 10, 2022

We have exactly the same problem here, when trying to connect to OVH managed databases

@arey
Copy link
Owner

arey commented Jun 18, 2022

@toussa if you want, I could update the Dockefile to use the MySQL 8 image as suggests @ysiivan
@ysiivan do you stiil have the Dockerfile you have used?

@toussa
Copy link

toussa commented Jun 21, 2022

@arey thanks for the proposition but there is no need of a Dockerfile for mysql:8 image, because it has everything inside (and actually too much if you just use the client).

For example, my docker compose looks like:

mysql-cli:
    image: mysql:8
    entrypoint: "mysql"

However, a useful Dockerfile might be to remove what is not needed for mysql client to work

@arey
Copy link
Owner

arey commented Jul 14, 2022

Thank tou @toussa for your feedback.
Another solution could be to install the missing /usr/lib/mariadb/plugin/caching_sha2_password.so shared library to the image.
If anyone is interested, you're welcome.

@olivernybroe
Copy link
Contributor

A solution here which installs caching_sha2_password is to add the following package mariadb-connector-c-dev

@pandasir
Copy link

A solution here which installs caching_sha2_password is to add the following package mariadb-connector-c-dev

nice 😃

@arey
Copy link
Owner

arey commented May 31, 2023

Hi @olivernybroe and @pandasir
Could you please submit a Pull Request with this change? Thus I could publish a fixed version.
Thanks :-D

olivernybroe added a commit to olivernybroe/mysql-client that referenced this issue May 31, 2023
@arey
Copy link
Owner

arey commented Jun 1, 2023

Thanks to @olivernybroe the path has been pushed to Docker Hub. I let you try it.

@ionling
Copy link

ionling commented Jul 4, 2023

A solution here which installs caching_sha2_password is to add the following package mariadb-connector-c-dev

I found that mariadb-connector-c is sufficient.

@arey
Copy link
Owner

arey commented Jul 6, 2023

Thanks for the feedback @ionling
If you want you could submit a Pull Request and change mariadb-connector-c-dev to mariadb-connector-c

@rodrigosampayo1
Copy link

rodrigosampayo1 commented Dec 27, 2023

Same error using mysql:8 on docker compose -> Fix: in my dockerfile add this:

FROM alpine:3.14
...
RUN apk add --no-cache mariadb-connector-c

@arey
Copy link
Owner

arey commented Dec 27, 2023

I @rodrigosampayo1 which image version are you using?
I thought the problem had been solved with the latest image https://hub.docker.com/layers/arey/mysql-client/latest/images/sha256-54f844baa87f675879b0aa409344b5d51ad2d4fcf240580fc1dde7689cfbccf0?context=repo

@RickMeijer
Copy link

Unfortuntely, I had the same issue (and fortunately the same fix).
I'm running a cron container, building from alpine, same as @rodrigosampayo1

FROM alpine:3
...
RUN apk add --no-cache mysql-client mariadb-connector-c
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants