diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index e7084d86f9c..0f4760c468f 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -338,7 +338,7 @@ if [ $BASE_SYSTEM != "netware" ] ; then copyfileto $BASE/bin scripts/* $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ \ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ \ - @HOSTNAME@ \@pkgdatadir\@ ./support-files \ + @HOSTNAME@ \@pkgdatadir\@ ./share \ < scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \ \@sbindir\@ ./bin \@libexecdir\@ ./bin \ diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index bd90e6916b1..67084f416e0 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -18,26 +18,68 @@ # # All unrecognized arguments to this script are passed to mysqld. -in_rpm=0 -windows=0 +basedir="" +ldata="" +srcdir="" + +args="" defaults="" +mysqld_opt="" user="" -case "$1" in - --no-defaults|--defaults-file=*|--defaults-extra-file=*) - defaults="$1"; shift - ;; -esac +force=0 +in_rpm=0 +ip_only=0 +windows=0 + +usage() +{ + cat <&1` if [ $? -ne 0 ] @@ -244,39 +305,36 @@ then fi fi -if test "$ip_only" = "1" +if test "$ip_only" -eq 1 then - ip=`echo "$resolved" | awk '/ /{print $6}'` - hostname=$ip + hostname=`echo "$resolved" | awk '/ /{print $6}'` fi # Create database directories mysql & test -if test ! -d $ldata; then - mkdir $ldata; - chmod 700 $ldata ; -fi -if test ! -d $ldata/mysql; then - mkdir $ldata/mysql; - chmod 700 $ldata/mysql ; -fi -if test ! -d $ldata/test; then - mkdir $ldata/test; - chmod 700 $ldata/test ; -fi -if test -w / -a ! -z "$user"; then - chown $user $ldata $ldata/mysql $ldata/test; -fi +for dir in $ldata $ldata/mysql $ldata/test +do + if test ! -d $dir + then + mkdir -p $dir + chmod 700 $dir + fi + if test -w / -a ! -z "$user" + then + chown $user $dir + fi +done -if test -n "$user"; then +if test -n "$user" +then args="$args --user=$user" fi # Peform the install of system tables mysqld_bootstrap="${MYSQLD_BOOTSTRAP-$mysqld}" mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \ ---basedir=$basedir --datadir=$ldata --loose-skip-innodb \ ---loose-skip-ndbcluster $args --max_allowed_packet=8M \ ---net_buffer_length=16K" + --basedir=$basedir --datadir=$ldata --loose-skip-innodb \ + --loose-skip-ndbcluster $args --max_allowed_packet=8M \ + --net_buffer_length=16K" # Pipe mysql_system_tables.sql to "mysqld --bootstrap" s_echo "Installing MySQL system tables..." @@ -284,23 +342,20 @@ if `(echo "use mysql;"; cat $create_system_tables $fill_system_tables) | $mysqld then s_echo "OK" - if test -n "$fill_help_tables" + s_echo "Filling help tables..." + # Pipe fill_help_tables.sql to "mysqld --bootstrap" + if `(echo "use mysql;"; cat $fill_help_tables) | $mysqld_install_cmd_line` then - s_echo "Filling help tables..." - # Pipe fill_help_tables.sql to "mysqld --bootstrap" - if `(echo "use mysql;"; cat $fill_help_tables) | $mysqld_install_cmd_line` - then - # Fill suceeded - s_echo "OK" - else - echo "" - echo "WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!" - echo "The \"HELP\" command might not work properly" - echo "" - fi + # Fill suceeded + s_echo "OK" + else + echo + echo "WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!" + echo "The \"HELP\" command might not work properly" + echo fi - s_echo "" + s_echo s_echo "To start mysqld at boot time you have to copy" s_echo "support-files/mysql.server to the right place for your system" s_echo @@ -319,7 +374,7 @@ then echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" echo "See the manual for more instructions." - if test "$in_rpm" = "0" + if test "$in_rpm" -eq 0 then echo "You can start the MySQL daemon with:" echo "cd @prefix@ ; $bindir/mysqld_safe &"