File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,12 @@ DEFAULT_LOG["5.6"]=""
78
78
DEFAULT_LOG[" 5.7" ]=" "
79
79
DEFAULT_LOG[" 8.0" ]=" console"
80
80
81
+ # MySQL 8.0 supports a call to validate the config, while older versions have it as a side
82
+ # effect of running --verbose --help
83
+ declare -A VALIDATE_CONFIG
84
+ VALIDATE_CONFIG[" 5.6" ]=" output=$( \" $@ \" --verbose --help 2>&1 > /dev/null) || result=$? "
85
+ VALIDATE_CONFIG[" 5.7" ]=" output=$( \" $@ \" --verbose --help 2>&1 > /dev/null) || result=$? "
86
+ VALIDATE_CONFIG[" 8.0" ]=" output=$( \" $@ \" --validate-config) || result=$? "
81
87
82
88
for VERSION in " ${! MYSQL_SERVER_VERSIONS[@]} "
83
89
do
119
125
sed -i ' s#%%STARTUP_WAIT%%#' " ${STARTUP_WAIT[${VERSION}]} " ' #g' tmpfile
120
126
sed -i ' s#%%FULL_SERVER_VERSION%%#' " ${FULL_SERVER_VERSIONS[${VERSION}]} " ' #g' tmpfile
121
127
sed -i ' s#%%DEFAULT_LOG%%#' " ${DEFAULT_LOG[${VERSION}]} " ' #g' tmpfile
128
+ sed -i ' s#%%VALIDATE_CONFIG%%#' " ${VALIDATE_CONFIG[${VERSION}]} " ' #g' tmpfile
122
129
mv tmpfile ${VERSION} /docker-entrypoint.sh
123
130
chmod +x ${VERSION} /docker-entrypoint.sh
124
131
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ if [ "$1" = 'mysqld' ]; then
35
35
# Test that the server can start. We redirect stdout to /dev/null so
36
36
# only the error messages are left.
37
37
result=0
38
- output= $( " $@ " --verbose --help 2>&1 > /dev/null ) || result= $?
38
+ %%VALIDATE_CONFIG%%
39
39
if [ ! " $result " = " 0" ]; then
40
40
echo >&2 ' [Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.'
41
41
echo >&2 " [Entrypoint] $output "
You can’t perform that action at this time.
0 commit comments