Skip to content

See if we can connect from within the container #5

See if we can connect from within the container

See if we can connect from within the container #5

Workflow file for this run

name: MySQL Service Connect
on:
push:
workflow_dispatch:
jobs:
unit-test:
name: Unit Testing
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
options: --name mysql_container --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=password -e MYSQL_USER=test -e MYSQL_PASSWORD=test -e MYSQL_DATABASE=e2e-tests --entrypoint sh mysql:8 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"
steps:
- run: docker exec mysql_container mysql --protocol tcp --host localhost --port 3306 -uroot -ppassword -e "SHOW DATABASES"
- name: Verify MySQL connection from host
run: mysql --protocol tcp --host localhost --port 3306 -uroot -ppassword -e "SHOW DATABASES"