summaryrefslogtreecommitdiff
path: root/scripts/mysql_install_db.sh
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2012-10-18 23:33:06 +0200
committerSergei Golubchik <sergii@pisem.net>2012-10-18 23:33:06 +0200
commit68baf07dcd985376fae9d24c12ee0ff560b61e8f (patch)
tree175f775e9847a50e7b51162573ae24f276abea96 /scripts/mysql_install_db.sh
parentcbaf6e6b61241db6e97648c73dbeb0a15614a7aa (diff)
parent362c2bca3e170031d33622f27d978c9570d0a9f5 (diff)
downloadmariadb-git-68baf07dcd985376fae9d24c12ee0ff560b61e8f.tar.gz
5.3 merge
Diffstat (limited to 'scripts/mysql_install_db.sh')
-rw-r--r--scripts/mysql_install_db.sh50
1 files changed, 28 insertions, 22 deletions
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 0ed94d0ffa3..7ebd78e3b6d 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -257,7 +257,7 @@ fi
# Now we can get arguments from the groups [mysqld] and [mysql_install_db]
# in the my.cfg file, then re-run to merge with command line arguments.
-parse_arguments `$print_defaults $defaults mysqld mariadb mysql_install_db client-server`
+parse_arguments `"$print_defaults" $defaults mysqld mariadb mysql_install_db client-server`
parse_arguments PICK-ARGS-FROM-ARGV "$@"
# Configure paths to support files
@@ -307,7 +307,7 @@ fill_help_tables="$pkgdatadir/fill_help_tables.sql"
create_system_tables="$pkgdatadir/mysql_system_tables.sql"
fill_system_tables="$pkgdatadir/mysql_system_tables_data.sql"
-for f in $fill_help_tables $create_system_tables $fill_system_tables
+for f in "$fill_help_tables" "$create_system_tables" "$fill_system_tables"
do
if test ! -f "$f"
then
@@ -329,8 +329,10 @@ then
cannot_find_file "$langdir/errmsg.sys"
exit 1
fi
- mysqld_opt="--lc-messages-dir=$langdir/.."
+else
+ langdir=english
fi
+mysqld_opt="--lc-messages=$langdir"
# Try to determine the hostname
hostname=`@HOSTNAME@`
@@ -338,14 +340,14 @@ hostname=`@HOSTNAME@`
# Check if hostname is valid
if test "$cross_bootstrap" -eq 0 -a "$in_rpm" -eq 0 -a "$force" -eq 0
then
- resolved=`$extra_bindir/resolveip $hostname 2>&1`
+ resolved=`"$extra_bindir/resolveip" $hostname 2>&1`
if test $? -ne 0
then
- resolved=`$extra_bindir/resolveip localhost 2>&1`
+ resolved=`"$extra_bindir/resolveip" localhost 2>&1`
if test $? -ne 0
then
echo "Neither host '$hostname' nor 'localhost' could be looked up with"
- echo "$extra_bindir/resolveip"
+ echo "'$extra_bindir/resolveip'"
echo "Please configure the 'hostname' command to return a correct"
echo "hostname."
echo "If you want to solve this at a later stage, restart this script"
@@ -368,21 +370,21 @@ then
fi
# Create database directories
-for dir in $ldata $ldata/mysql $ldata/test
+for dir in "$ldata" "$ldata/mysql" "$ldata/test"
do
- if test ! -d $dir
+ if test ! -d "$dir"
then
- if ! `mkdir -p $dir`
+ if ! `mkdir -p "$dir"`
then
echo "Fatal error Can't create database directory '$dir'"
link_to_help
exit 1
fi
- chmod 700 $dir
+ chmod 700 "$dir"
fi
if test -n "$user"
then
- chown $user $dir
+ chown $user "$dir"
if test $? -ne 0
then
echo "Cannot change ownership of the database directories to the '$user'"
@@ -409,15 +411,19 @@ fi
# Configure mysqld command line
mysqld_bootstrap="${MYSQLD_BOOTSTRAP-$mysqld}"
-mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \
- --basedir=$basedir --datadir=$ldata --log-warnings=0 --loose-skip-innodb \
+mysqld_install_cmd_line()
+{
+ "$mysqld_bootstrap" $defaults "$mysqld_opt" --bootstrap \
+ "--basedir=$basedir" "--datadir=$ldata" --log-warnings=0 --loose-skip-innodb \
--loose-skip-ndbcluster --loose-skip-pbxt $args --max_allowed_packet=8M \
--default-storage-engine=myisam \
- --net_buffer_length=16K"
+ --net_buffer_length=16K
+}
+
# Create the system and help tables by passing them to "mysqld --bootstrap"
s_echo "Installing MariaDB/MySQL system tables in '$ldata' ..."
-if { echo "use mysql;"; cat $create_system_tables $fill_system_tables; } | eval "$filter_cmd_line" | $mysqld_install_cmd_line > /dev/null
+if { echo "use mysql;"; cat "$create_system_tables" "$fill_system_tables"; } | eval "$filter_cmd_line" | mysqld_install_cmd_line > /dev/null
then
s_echo "OK"
else
@@ -452,7 +458,7 @@ else
fi
s_echo "Filling help tables..."
-if { echo "use mysql;"; cat $fill_help_tables; } | $mysqld_install_cmd_line > /dev/null
+if { echo "use mysql;"; cat "$fill_help_tables"; } | mysqld_install_cmd_line > /dev/null
then
s_echo "OK"
else
@@ -474,11 +480,11 @@ then
echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !"
echo "To do so, start the server, then issue the following commands:"
echo
- echo "$bindir/mysqladmin -u root password 'new-password'"
- echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'"
+ echo "'$bindir/mysqladmin' -u root password 'new-password'"
+ echo "'$bindir/mysqladmin' -u root -h $hostname password 'new-password'"
echo
echo "Alternatively you can run:"
- echo "$bindir/mysql_secure_installation"
+ echo "'$bindir/mysql_secure_installation'"
echo
echo "which will also give you the option of removing the test"
echo "databases and anonymous user created by default. This is"
@@ -491,14 +497,14 @@ then
then
echo
echo "You can start the MariaDB daemon with:"
- echo "cd $basedir ; $bindir/mysqld_safe --datadir=$ldata"
+ echo "cd '$basedir' ; $bindir/mysqld_safe --datadir='$ldata'"
echo
echo "You can test the MariaDB daemon with mysql-test-run.pl"
- echo "cd $basedir/mysql-test ; perl mysql-test-run.pl"
+ echo "cd '$basedir/mysql-test' ; perl mysql-test-run.pl"
fi
echo
- echo "Please report any problems with the $scriptdir/mysqlbug script!"
+ echo "Please report any problems with the '$scriptdir/mysqlbug' script!"
echo
echo "The latest information about MariaDB is available at http://mariadb.org/."
echo "You can find additional information about the MySQL part at:"