Comments (11)
@jasonmccallister Found the dependency it's mariadb-connector-c
, this package adds the plugin that's missing. I can add this to my own Dockerfile, or if you are willing to include in the dev Craft Docker images potentially? This seems like a potentially broken mysqldump situation with MySQL 8 environments out of the box.
The whole caching_sha2_password situation has been a right mess. MariaDB themselves even noped out on it: https://mariadb.com/kb/en/authentication-plugin-sha-256/
However, the fix is having mariadb-connector-c
package from Alpine installed.
from docker.
@khalwat Thanks! I have submitted a PR with the package added to the PHP 7.4 and 8.0 dev images. Despite the PHP docs, it seems 7.4 is the first PHP version to have full support.
from docker.
Changes by @jamesmacwhite (thank you!) have been merged, I will tag a release in the next couple of days to trigger a new build.
from docker.
I'm aware that you can switch to native password, but this wouldn't seem to be the right thing given a library is missing entirely and Craft 3 should of course be able to support the caching_sha2_password mechanism with the PHP 7.4 dev image.
Is there perhaps a missing package that contains the libraries in addition to mysql-client
?
from docker.
Hi @jamesmacwhite, are you using the -dev
images or the non-dev? The -dev
images install mysql-client tools because they are using for the Nitro sites containers... The non-dev images do not install composer, git, or the database tools.
In the usage section we document how to add your own extensions and backup tools. These are from the Alpine Linux repository which appear to be mariadb.
from docker.
Hi @jasonmccallister. Yep using the dev images PHP 7.4 dev to be exact. I noticed these were added to the images more recently, which is nice I had modified our Dockerfile to add git, and mysql-client manually but since pulled the latest PHP FPM image to negate doing that now.
It does indeed appear to be that the Alpine packages are built against mariadb. I'm trying to get some further understanding on why the library file is missing entirely. I was wondering if there's a further dependency package needed or something, although even in Docker related searches I'm not getting a clear picture why the lib file isn't present. A lot of the guidance is switch to native password, but that's not the fix, because caching_sha2_password should be handled fine with MySQL 8 and Craft 3, it appears it's just the library itself is just not there. Perhaps not a bug in these Docker images specifically but something with Alpine?
The whole folder plugin folder being empty is a bit strange.
from docker.
By default the mysql-client package does not have support for caching_sha2_password because it is built against mariadb, so the addition of this package is needed for supporting modern connections to MySQL 8, where native password is not used or has been enabled (Any newly provisioned MySQL 8 DB is unlikely to have it enabled). The MySQL 8 container itself of course supports this without any problems, but mysqldump will be running from the PHP-FPM container which is where this problem is coming from.
Certainly on the dev images it would be nice to have the mariadb-connector-c
package installed. Anyone who's using these docker images with MySQL 8, who hasn't allowed their database to use the legacy native password method is going to hit this, possibly in Nitro as well?
from docker.
@jamesmacwhite I've experienced this for a while (not specific to the Craft Docker image) and couldn't for the life of me figure out which extra dependency I needed to add. Thanks for figuring it out! 🎉
Can confirm adding that to our Dockerfile allows Craft's backup commands to work OOTB with MySQL8.
from docker.
@kylecotter Glad it helped! Hoping @jasonmccallister will implement this dependency directly in the dev images. After discovering the MySQL client tools package is built against MariaDB, it doesn't have support for caching_sha2_paasword by default and likely never will given MariaDB doesn't support it out of the box either.
I guess only MySQL 8 specifically is hit when the default password mechanism changed. 5.7 and lower will not encounter it, MariaDB won't either as it doesn't use it.
from docker.
Thx @jamesmacwhite -- this fixed it for me as well.
@jasonmccallister you'll likely want to add mariadb-connector-c
to the base images; a bet a fair number of people will be picking mysql:8.0
as their db of choice, since that's the example in the docs.
from docker.
@jamesmacwhite @khalwat either of you ever have the issue with the dump from this setup not actually be importable elsewhere?
from docker.
Related Issues (20)
- Craft install fails - nl is not a valid language. HOT 4
- [8.x] Missing Locales HOT 9
- Security vulnerabilities reported in container re. libpq and zlib HOT 2
- Expat security vulnerability HOT 6
- Security vulnerabilities reported in container HOT 4
- Imagick does not limit its memory usage, can crash php-fpm processes HOT 3
- Python security vulnerability HOT 1
- libtasn1 vulnerability reported HOT 2
- High vulnerability reported in `libde265` HOT 2
- Dev image performance is 10x slower than prod HOT 3
- High vulnerability reported in `tar-1.34-r0` HOT 1
- CVEs HOT 5
- Make Nginx document root configurable
- New CVEs HOT 14
- Upgrade pgdump to 15.3 HOT 2
- github-tag-action runs too often HOT 2
- Supervisord INFO reaped unknown pid HOT 1
- Update Alpine so CVE-2023-38545 can be resolved HOT 2
- README Example for database tools to enable exports/backups needs to be updated
- Add PHP 8.3 images HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker.