Example of my GitHub Action config:
jobs:
unit-test:
name: Unit Testing
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: db
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5
steps:
- name: Verify MySQL connection from host
run: mysql --host mysql --port 3306 -uroot -ppassword -e "SHOW DATABASES"
With MySQL 5.7 it works. But with MySQL 8.0 it shows:
ERROR 1045 (28000): Plugin caching_sha2_password could not be loaded: ...
In MySQL docker docs there is a line which allows mysql_native_password auth:
command: --default-authentication-plugin=mysql_native_password
How to allow the mysql_native_password auth plugin in GitHub Actions/service?