diff --git a/docker-compose.yml b/docker-compose.yml index e04977b..3d1d28c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -32,17 +32,20 @@ services: mysql: image: mysql:${MYSQL_VERSION} - command: mysqld --local-infile --port=3306 --mysql-native-password=ON + entrypoint: /usr/local/bin/entrypoint.sh + volumes: + - ./docker/mysql-entrypoint.sh:/usr/local/bin/entrypoint.sh environment: MYSQL_DATABASE: test MYSQL_ROOT_PASSWORD: rootpassword mysql-ssl: image: mysql:${MYSQL_VERSION} - command: mysqld --local-infile --port=3306 --mysql-native-password=ON + entrypoint: /usr/local/bin/entrypoint.sh volumes: - ./docker/ssl/certificates:/ssl-cert - ./docker/mysql-ssl/${MYSQL_VERSION}/conf.d:/etc/mysql/conf.d + - ./docker/mysql-entrypoint.sh:/usr/local/bin/entrypoint.sh environment: MYSQL_DATABASE: test MYSQL_ROOT_PASSWORD: rootpassword diff --git a/docker/mysql-entrypoint.sh b/docker/mysql-entrypoint.sh new file mode 100755 index 0000000..c2bba3b --- /dev/null +++ b/docker/mysql-entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +if [ "${MYSQL_VERSION}" = "5.6" ]; then + exec docker-entrypoint.sh mysqld --local-infile --port=3306 --default-authentication-plugin=mysql_native_password +else + exec docker-entrypoint.sh mysqld --local-infile --port=3306 --mysql-native-password=ON +fi