File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -197,8 +197,16 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
197197 FLUSH PRIVILEGES ;
198198 EOSQL
199199
200+ # Store the password in a file so we don't use it on the command line
201+ install -d -m0700 /tmp/mysql-files
202+ PASSFILE=$( mktemp /tmp/mysql-files/XXXXXXXXXX)
203+ install /dev/null -m0600 " ${PASSFILE} "
200204 if [ ! -z " $MYSQL_ROOT_PASSWORD " ]; then
201- mysql+=( -p" ${MYSQL_ROOT_PASSWORD} " )
205+ cat > " ${PASSFILE} " << EOF
206+ [client]
207+ password="${MYSQL_ROOT_PASSWORD} "
208+ EOF
209+ mysql+=( --defaults-extra-file=" ${PASSFILE} " )
202210 fi
203211
204212 file_env ' MYSQL_DATABASE'
@@ -232,6 +240,8 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
232240 _note " Stopping server"
233241 _stop_server $pid
234242 _note " Server stopped"
243+ rm -f " ${PASSFILE} "
244+ unset PASSFILE
235245 echo
236246 _note " MySQL init process done. Ready for start up."
237247 echo
You can’t perform that action at this time.
0 commit comments