summaryrefslogtreecommitdiff
path: root/scripts/mysql_install_db.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mysql_install_db.sh')
-rw-r--r--scripts/mysql_install_db.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index abde6ecbe73..ff5753d9bad 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -10,6 +10,7 @@
in_rpm=0
windows=0
defaults=""
+user=""
tmp_file=/tmp/mysql_install_db.$$
case "$1" in
@@ -34,7 +35,11 @@ parse_arguments() {
--force) force=1 ;;
--basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--ldata=*|--datadir=*) ldata=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
- --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
+ --user=*)
+ # Note that the user will be passed to mysqld so that it runs
+ # as 'user' (crucial e.g. if log-bin=/some_other_path/
+ # where a chown of datadir won't help)
+ user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--skip-name-resolve) ip_only=1 ;;
--verbose) verbose=1 ;;
--rpm) in_rpm=1 ;;
@@ -198,6 +203,10 @@ else
create_option="real"
fi
+if test -n "$user"; then
+ args="$args --user=$user"
+fi
+
if test "$in_rpm" -eq 0 -a "$windows" -eq 0
then
echo "Installing all prepared tables"