Skip to content

Commit cd0813e

Browse files
committed
MDEV-8534 [PATCH] mysql_secure_installation doesn't pass "socket" to "mysql"
fix the previous patch to pass defaults-file to parse_arguments
1 parent 39f5234 commit cd0813e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

scripts/mysql_secure_installation.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ parse_arguments()
5050
do
5151
case "$arg" in
5252
--basedir=*) basedir=`parse_arg "$arg"` ;;
53-
--defaults-file=*) defaults_file=`parse_arg "$arg"` ;;
53+
--defaults-file=*) defaults_file="$arg" ;;
5454
--defaults-extra-file=*) defaults_extra_file="$arg" ;;
5555
--no-defaults) no_defaults="$arg" ;;
5656
*)
@@ -171,7 +171,7 @@ fi
171171

172172
# Now we can get arguments from the group [client] and [client-server]
173173
# in the my.cfg file, then re-run to merge with command line arguments.
174-
parse_arguments `$print_defaults $defaults client client-server client-mariadb`
174+
parse_arguments `$print_defaults $defaults_file $defaults_extra_file $no_defaults client client-server client-mariadb`
175175
parse_arguments PICK-ARGS-FROM-ARGV "$@"
176176

177177
# Configure paths to support files
@@ -232,6 +232,10 @@ basic_single_escape () {
232232
echo "$1" | sed 's/\(['"'"'\]\)/\\\1/g'
233233
}
234234

235+
#
236+
# create a simple my.cnf file to be able to pass the root password to the mysql
237+
# client without putting it on the command line
238+
#
235239
make_config() {
236240
echo "# mysql_secure_installation config file" >$config
237241
echo "[mysql]" >>$config
@@ -242,7 +246,8 @@ make_config() {
242246

243247
if test -n "$defaults_file"
244248
then
245-
cat "$defaults_file" >>$config
249+
dfile=`parse_arg "$defaults_file"`
250+
cat "$dfile" >>$config
246251
fi
247252
}
248253

0 commit comments

Comments
 (0)