GitHub actions + MySQL: can't set lower_case_table_names variable

Hello!

I am trying to change lower_case_table_names variable in MySQL docker hub with GitHub Actions. I am using mysql docker (Docker Hub) but it does not work. I have tried both: by using an additional cnf file, and by changing the variable when running mysql.

My stack.yml file is:


version: '3.1'

  services:

    db:
      image: mysql
      restart: always
      environment:
        MYSQL_ROOT_PASSWORD: root
        MYSQL_DATABASE: myDatabase
      ports:
        - "3308:3306"
        
    adminer:
      image: adminer
      restart: always
      ports:
        - 8080:8080

and my workflow.yml file is:

name: Build and test of Java Project
 
on: [push]
 
jobs:
 build:
   runs-on: ubuntu-latest
   timeout-minutes: 2.5
  
   steps:
     - uses: actions/checkout@v2
     - name: Set up JDK 1.8
       uses: actions/setup-java@v1
       with:
         java-version: 1.8
     - name: Setup timezone
       uses: zcong1993/setup-timezone@master
       with:
          timezone: Europe/Madrid
     - name: Create test database
       run: | 
         sudo docker --version
         sudo docker swarm init
         sudo docker stack deploy -c stack.yml mysql
         sudo docker run --name mysql -e MYSQL_ROOT_PASSWORD=root -d mysql:latest
         sudo docker stack ps mysql
         sudo docker ps
         sudo service mysql start
         mysql -u root -proot  < ./create_tables.sql
     - name: Build with Maven
       run: mvn -B test --file pom.xml

I have tried several options:

  • (without my own cnf file) inserting the instruction command: --lower_case_table_names=1 after the “image” instruction in the stack.yml file.
  • (without my own cnf file) running mysql by: sudo docker run --name mysql -e MYSQL_ROOT_PASSWORD=root -d mysql:latest --lower_case_table_names=1
  • with an own cnf file, changing the running instruction to: sudo docker run --name mysql -v /mysql:/etc/mysql/conf.d -e MYSQL_ROOT_PASSWORD=root -d mysql:latest and with my.cnf file as: [mysqld] lower_case_table_names = 1

Any help? Thank you very much.