Skip to content

Commit a92221f

Browse files
committed
specify mysql_native_password auth plugin for mysql images older than 9
1 parent bd0dd76 commit a92221f

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,7 @@ fixup:
9595

9696
setup-mysql-volume:
9797
$(eval export DOCKER_MYSQL_VOLUME=$(shell echo ${DOCKER_MYSQL_IMAGE} | sed -e 's/\..*//; s/[^a-zA-Z0-9]//g'))
98-
ifeq (${DOCKER_MYSQL_COMMAND},)
99-
$(eval export DOCKER_MYSQL_COMMAND=$(shell if echo ${DOCKER_MYSQL_IMAGE} | egrep -q '^mysql:(9|[1-9][0-9]+)$$'; then echo ''; else echo '--default-authentication-plugin=mysql_native_password'; fi))
100-
endif
98+
$(eval export DOCKER_MYSQL_COMMAND_AUTH_PLUGIN=$(shell if ! echo ${DOCKER_MYSQL_IMAGE} | egrep -q '^mysql:(9|[1-9][0-9]+)$$'; then echo '--default-authentication-plugin=mysql_native_password'; fi))
10199

102100
ifneq (${SQL},)
103101
MYSQL_COMMAND_ARGS=-e '${SQL}'

mt/mysql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ services:
33
image: ${DOCKER_MYSQL_IMAGE:-mysql:8.0.32}
44
environment:
55
MYSQL_ROOT_PASSWORD: password
6-
command: ${DOCKER_MYSQL_COMMAND}
6+
command: ${DOCKER_MYSQL_COMMAND} ${DOCKER_MYSQL_COMMAND_AUTH_PLUGIN}
77
volumes:
88
- "..:/mt-dev"
99
- "./mysql/conf.d:/etc/mysql/conf.d"

0 commit comments

Comments
 (0)