summaryrefslogtreecommitdiff
path: root/scripts/mysqld_safe.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mysqld_safe.sh')
-rw-r--r--scripts/mysqld_safe.sh14
1 files changed, 10 insertions, 4 deletions
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index ece4ba098f4..0f415ccd5f0 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -46,8 +46,9 @@ parse_arguments() {
--user=*)
if test $SET_USER -eq 0
then
- user=`echo "$arg" | sed -e "s;--[^=]*=;;"` ; SET_USER=1
+ user=`echo "$arg" | sed -e "s;--[^=]*=;;"`
fi
+ SET_USER=1
;;
# these two might have been set in a [mysqld_safe] section of my.cnf
@@ -114,7 +115,6 @@ else
ledir=@libexecdir@
fi
-safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}}
user=@MYSQLD_USER@
niceness=0
@@ -129,7 +129,6 @@ fi
# these rely on $DATADIR by default, so we'll set them later on
pid_file=
err_log=
-SET_USER=0
# Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe]
# and then merge with the command line arguments
@@ -147,8 +146,15 @@ else
fi
args=
-parse_arguments `$print_defaults --loose-verbose $defaults mysqld server mysqld_safe safe_mysqld`
+SET_USER=2
+parse_arguments `$print_defaults --loose-verbose $defaults mysqld server`
+if test $SET_USER -eq 2
+then
+ SET_USER=0
+fi
+parse_arguments `$print_defaults --loose-verbose $defaults mysqld_safe safe_mysqld`
parse_arguments PICK-ARGS-FROM-ARGV "$@"
+safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}}
if test ! -x $ledir/$MYSQLD
then