File tree 1 file changed +11
-1
lines changed
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
197
197
FLUSH PRIVILEGES ;
198
198
EOSQL
199
199
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} "
200
204
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} " )
202
210
fi
203
211
204
212
file_env ' MYSQL_DATABASE'
@@ -232,6 +240,8 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
232
240
_note " Stopping server"
233
241
_stop_server $pid
234
242
_note " Server stopped"
243
+ rm -f " ${PASSFILE} "
244
+ unset PASSFILE
235
245
echo
236
246
_note " MySQL init process done. Ready for start up."
237
247
echo
You can’t perform that action at this time.
0 commit comments