1

I installed laravel 8 via sail. By default docker-compose.yml use mysql:8. But I need to change mysql version to 5.6 or 5.7.

When I run sail up -d and than run docker-compose ps I see that mysql container not running:

myproject_mysql_1          docker-entrypoint.sh mysqld      Exit 2 

My docker-compose.yml (I changed only "image" property):


    mysql:
        image: 'mysql:5.7'
        ports:
            - '${FORWARD_DB_PORT:-3306}:3306'
        environment:
            MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
            MYSQL_DATABASE: '${DB_DATABASE}'
            MYSQL_USER: '${DB_USERNAME}'
            MYSQL_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
        volumes:
            - 'sailmysql:/var/lib/mysql'
        networks:
            - sail
        healthcheck:
          test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
          retries: 3
          timeout: 5s

And I created new Dockerfile for php image and I only changed php version from 8 to 7.3 in this file.

Other containers work correctly. When I change mysql version to 8, mysql container works correctly to.

shaedrich
  • 5,457
  • 3
  • 26
  • 42
  • note that 5.6 is no longer supported by oracle; that means no security fixes, unless you pay a third party (percona, for one) for support. soon this will be true of 5.7 as well. – ysth Jun 03 '21 at 22:33
  • Is there any error in [the log files](https://docs.docker.com/engine/reference/commandline/logs/)? – shaedrich Jun 04 '21 at 11:00

1 Answers1

1

Use command:

sail down --rmi all -v

Old volumes was deleted and ploblem was solved.

lemon
  • 14,875
  • 6
  • 18
  • 38