Description
Because this image is based on Alpine, when asked to install MySQL client it actually installs MariaDB's instead. This is often a reasonable substitution, but here it's fatal.
The problem is that Laravel 8's schema dump restore process (which makes CI pipelines run so much faster) builds a command line for the mysql
CLI client and uses it to import the schema. MariaDB's CLI client is incompatible with MySQL 8.0 due to lack of support for its default auth mechanism, caching_sha2_password
, so unless you also want to have to reconfigure your MySQL server (meaning you can't simply enable it using services: mysql:8.0
in your CI config) you have to disable schema dump and have your tests run slowly.
The command "mysql --user="${:LARAVEL_LOAD_USER}" --password="${:LARAVEL_LOAD_PASSWORD}" --host="${:LARAVEL_LOAD_HOST}" --port="${:LARAVEL_LOAD_PORT}" --database="${:LARAVEL_LOAD_DATABASE}" < "${:LARAVEL_LOAD_PATH}"" failed.
Exit Code: 1(General error)
Working directory: /builds/myapp
Output:
================
Error Output:
================
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
It's only the MaraDB client that's the problem. This is tricky to fix for Alpine Linux because it does not have a real MySQL package, even though MySQL includes support for Alpine.
I've been looking through various Laravel/PHP focused images for CI, and nearly all seem to suffer this problem, so I'm hoping one will fix it!