Commit cd0813e3 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-8534 [PATCH] mysql_secure_installation doesn't pass "socket" to "mysql"

fix the previous patch to pass defaults-file to parse_arguments
parent 39f5234a
...@@ -50,7 +50,7 @@ parse_arguments() ...@@ -50,7 +50,7 @@ parse_arguments()
do do
case "$arg" in case "$arg" in
--basedir=*) basedir=`parse_arg "$arg"` ;; --basedir=*) basedir=`parse_arg "$arg"` ;;
--defaults-file=*) defaults_file=`parse_arg "$arg"` ;; --defaults-file=*) defaults_file="$arg" ;;
--defaults-extra-file=*) defaults_extra_file="$arg" ;; --defaults-extra-file=*) defaults_extra_file="$arg" ;;
--no-defaults) no_defaults="$arg" ;; --no-defaults) no_defaults="$arg" ;;
*) *)
...@@ -171,7 +171,7 @@ fi ...@@ -171,7 +171,7 @@ fi
# Now we can get arguments from the group [client] and [client-server] # Now we can get arguments from the group [client] and [client-server]
# in the my.cfg file, then re-run to merge with command line arguments. # in the my.cfg file, then re-run to merge with command line arguments.
parse_arguments `$print_defaults $defaults client client-server client-mariadb` parse_arguments `$print_defaults $defaults_file $defaults_extra_file $no_defaults client client-server client-mariadb`
parse_arguments PICK-ARGS-FROM-ARGV "$@" parse_arguments PICK-ARGS-FROM-ARGV "$@"
# Configure paths to support files # Configure paths to support files
...@@ -232,6 +232,10 @@ basic_single_escape () { ...@@ -232,6 +232,10 @@ basic_single_escape () {
echo "$1" | sed 's/\(['"'"'\]\)/\\\1/g' echo "$1" | sed 's/\(['"'"'\]\)/\\\1/g'
} }
#
# create a simple my.cnf file to be able to pass the root password to the mysql
# client without putting it on the command line
#
make_config() { make_config() {
echo "# mysql_secure_installation config file" >$config echo "# mysql_secure_installation config file" >$config
echo "[mysql]" >>$config echo "[mysql]" >>$config
...@@ -242,7 +246,8 @@ make_config() { ...@@ -242,7 +246,8 @@ make_config() {
if test -n "$defaults_file" if test -n "$defaults_file"
then then
cat "$defaults_file" >>$config dfile=`parse_arg "$defaults_file"`
cat "$dfile" >>$config
fi fi
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment