mysql-client
mysql-client copied to clipboard
MySQL 8.x - Plugin caching_sha2_password could not be loaded
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
Do you solve your issue? Do you have it with the published Docker image or by building yourself the Dockerfile of this repository?
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.
We have exactly the same problem here, when trying to connect to OVH managed databases
@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?
@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
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.
A solution here which installs caching_sha2_password is to add the following package mariadb-connector-c-dev
A solution here which installs
caching_sha2_passwordis to add the following packagemariadb-connector-c-dev
nice 😃
Hi @olivernybroe and @pandasir Could you please submit a Pull Request with this change? Thus I could publish a fixed version. Thanks :-D
Thanks to @olivernybroe the path has been pushed to Docker Hub. I let you try it.
A solution here which installs
caching_sha2_passwordis to add the following packagemariadb-connector-c-dev
I found that mariadb-connector-c is sufficient.
Thanks for the feedback @ionling
If you want you could submit a Pull Request and change mariadb-connector-c-dev to mariadb-connector-c
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
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
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
...