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.sh25
1 files changed, 21 insertions, 4 deletions
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index f32002f996e..ead30962376 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -31,6 +31,7 @@ defaults=""
defaults_group_suffix=""
mysqld_opt=""
user=""
+group=""
silent_startup="--silent-startup"
force=0
@@ -95,6 +96,11 @@ Usage: $0 [OPTIONS]
user. You must be root to use this option. By default
mysqld runs using your current login name and files and
directories that it creates will be owned by you.
+ --group=group_name The login group to use for running mysqld. Files and
+ directories created by mysqld will be owned by this
+ group. You must be root to use this option. By default
+ mysqld runs using your current group and files and
+ directories that it creates will be owned by you.
All other options are passed to the mysqld program
@@ -144,11 +150,11 @@ parse_arguments()
--ldata=*|--datadir=*|--data=*) ldata=`parse_arg "$arg"` ;;
--log-error=*)
log_error=`parse_arg "$arg"` ;;
- --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=`parse_arg "$arg"` ;;
+ --user=*) user=`parse_arg "$arg"` ;;
+ --group=*) group=`parse_arg "$arg"` ;;
--skip-name-resolve) ip_only=1 ;;
--verbose) verbose=1 ; silent_startup="" ;;
--rpm) in_rpm=1 ;;
@@ -468,7 +474,12 @@ do
fi
if test -n "$user"
then
- chown $user "$dir"
+ if test -z "$group"
+ then
+ chown $user $dir
+ else
+ chown $user:$group $dir
+ fi
if test $? -ne 0
then
echo "Cannot change ownership of the database directories to the '$user'"
@@ -502,6 +513,11 @@ then
args="$args --user=$user"
fi
+if test -n "$group"
+then
+ args="$args --group=$group"
+fi
+
if test -f "$ldata/mysql/user.frm"
then
echo "mysql.user table already exists!"
@@ -525,7 +541,7 @@ mysqld_install_cmd_line()
{
"$mysqld_bootstrap" $defaults $defaults_group_suffix "$mysqld_opt" --bootstrap $silent_startup\
"--basedir=$basedir" "--datadir=$ldata" --log-warnings=0 --enforce-storage-engine="" \
- "--plugin-dir=${plugindir}" \
+ "--plugin-dir=${plugindir}" --loose-disable-plugin-file-key-management \
$args --max_allowed_packet=8M \
--net_buffer_length=16K
}
@@ -560,6 +576,7 @@ cat_sql()
s_echo "Installing MariaDB/MySQL system tables in '$ldata' ..."
if cat_sql | eval "$filter_cmd_line" | mysqld_install_cmd_line > /dev/null
then
+ printf "@VERSION@-MariaDB" > "$ldata/mysql_upgrade_info"
s_echo "OK"
else
log_file_place=$ldata