Skip to content

Commit

Permalink
Fix mysql startup on version 5
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamVyborny committed Jun 20, 2024
1 parent 322923c commit 7fc089c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions docker/mysql-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7fc089c

Please sign in to comment.