1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-14 23:46:10 +00:00
freebsd-ports/databases/mysql41-server/files/patch-ab
Peter Hawkins 9d7c8151af Submitted by: Dirk Froemberg <ibex@physik.TU-Berlin.DE>
- Upgrade to mysql-3.22.9-beta
- fix build under ELF
1998-10-22 07:47:41 +00:00

128 lines
3.8 KiB
Plaintext

--- scripts/mysql_install_db.sh.orig Sun Oct 18 23:59:46 1998
+++ scripts/mysql_install_db.sh Wed Oct 21 15:22:31 1998
@@ -3,7 +3,6 @@
# For a more info consult the file COPYRIGHT distributed with this file
# This scripts creates the privilige tables db, host, user in mysql
-# It should be run from the top level installation directory.
#
# All arguments to this script is passed to safe_mysqld
@@ -11,36 +10,8 @@
if test "$1" = "-IN-RPM"
then
- # We are doing a rpm install.
- IN_RPM=1; shift
- # First check if we already have the mysql database.
- if test -f $mdata/user.frm-new -a ! -f $mdata/user.ISM
- then
- for file in $mdata/*.frm-new
- do
- dir=`dirname $file`
- bn=`basename $file .frm-new`
- cp $file $dir/$bn.frm
- done
- fi
-else
- if test ! -d "./data"
- then
- echo "Didn't find the 'data' directory in the current directory"
- echo "You should be in the distribution directory when executing this script"
- if test -d "../data"
- then
- echo "We will now try to execute this in the parent directory; If this doesn't"
- echo "work please go to the directory where unpacked this distribution"
- echo "and try again with 'scripts/mysql_install_db'"
- echo
- cd ..
- else
- echo "Please go to the directory where you unpacked this distribution"
- echo "and start this script with 'scripts/mysql_install_db'"
- exit 1
- fi
- fi
+ # Make -IN-RPM a noop, just in case...
+ shift
fi
if test ! -x @bindir@/mysqladmin
@@ -51,17 +22,6 @@
ls -l /usr/bin/mysql*
echo "Didn't find @bindir@/mysqladmin"
exit 1
- elif test "@localstatedir@" = "./data"
- then
- echo "Can't execute @bindir@/mysqladmin"
- echo "You should be in the distribution directory when executing this script"
- echo "Please go to the directory where you unpacked this distribution"
- echo "and start this script with 'scripts/mysql_install_db'"
- exit 1
- else
- echo "Didn't find @bindir@/mysqladmin"
- echo "You should do a 'make install' before executing this script"
- exit 1
fi
fi
@@ -84,9 +44,6 @@
fi
fi
-# On IRIX hostname is in /usr/bsd so add this to the path
-PATH=$PATH:/usr/bsd
-
hostname=`hostname` # Install this too in the user table
# create database mysql & test
@@ -142,10 +99,7 @@
then
if test ! -f @localstatedir@/mysql/user.frm
then
- if test "@localstatedir@" != "./data"
- then
- cp -p ./data/mysql/*.frm @localstatedir@/mysql
- fi
+ cp -p ./data/mysql/*.frm @localstatedir@/mysql
fi
fi
@@ -175,9 +129,6 @@
# Dumping data for table 'user'
#
-INSERT INTO user VALUES ('localhost','@MYSQLD_USER@','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
-INSERT INTO user VALUES ('$hostname','@MYSQLD_USER@','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
-
REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
@@ -185,6 +136,13 @@
INSERT INTO user VALUES ('$hostname','','','N','N','N','N','N','N','N','N','N','N');
END_OF_DATA
+if [ @MYSQLD_USER@ != root ]; then
+ @bindir@/mysql mysql <<END_OF_DATA
+INSERT INTO user VALUES ('localhost','@MYSQLD_USER@','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
+INSERT INTO user VALUES ('$hostname','@MYSQLD_USER@','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
+END_OF_DATA
+fi
+
if test $? -eq 0
then
@bindir@/mysqladmin reload
@@ -197,13 +155,6 @@
echo
echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !"
echo
- if test -z "$IN_RPM"
- then
- echo "You can test the MySQL demon with the benchmarks in the 'bench'"
- echo "directory:"
- echo "cd bench ; run-all-tests"
- echo
- fi
echo "You can also try the mysql command line tool with:"
echo "@bindir@/mysql test"
echo