1998-10-22 07:47:41 +00:00
|
|
|
--- 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
|
1998-08-14 12:05:42 +00:00
|
|
|
@@ -3,7 +3,6 @@
|
1998-03-16 02:46:42 +00:00
|
|
|
# For a more info consult the file COPYRIGHT distributed with this file
|
|
|
|
|
|
|
|
# This scripts creates the privilige tables db, host, user in mysql
|
1998-10-22 07:47:41 +00:00
|
|
|
-# It should be run from the top level installation directory.
|
1998-03-16 02:46:42 +00:00
|
|
|
#
|
|
|
|
# All arguments to this script is passed to safe_mysqld
|
|
|
|
|
1998-10-22 07:47:41 +00:00
|
|
|
@@ -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
|
1998-09-06 19:58:26 +00:00
|
|
|
-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
|
1998-10-22 07:47:41 +00:00
|
|
|
+ # Make -IN-RPM a noop, just in case...
|
|
|
|
+ shift
|
1998-09-06 19:58:26 +00:00
|
|
|
fi
|
1998-08-14 12:05:42 +00:00
|
|
|
|
1998-03-16 02:46:42 +00:00
|
|
|
if test ! -x @bindir@/mysqladmin
|
1998-10-22 07:47:41 +00:00
|
|
|
@@ -51,17 +22,6 @@
|
|
|
|
ls -l /usr/bin/mysql*
|
|
|
|
echo "Didn't find @bindir@/mysqladmin"
|
|
|
|
exit 1
|
|
|
|
- elif test "@localstatedir@" = "./data"
|
1998-03-16 02:46:42 +00:00
|
|
|
- then
|
1998-10-22 07:47:41 +00:00
|
|
|
- echo "Can't execute @bindir@/mysqladmin"
|
1998-03-16 02:46:42 +00:00
|
|
|
- echo "You should be in the distribution directory when executing this script"
|
1998-08-14 12:05:42 +00:00
|
|
|
- echo "Please go to the directory where you unpacked this distribution"
|
|
|
|
- echo "and start this script with 'scripts/mysql_install_db'"
|
1998-10-22 07:47:41 +00:00
|
|
|
- exit 1
|
1998-09-06 19:58:26 +00:00
|
|
|
- else
|
|
|
|
- echo "Didn't find @bindir@/mysqladmin"
|
|
|
|
- echo "You should do a 'make install' before executing this script"
|
|
|
|
- exit 1
|
1998-10-22 07:47:41 +00:00
|
|
|
fi
|
1998-03-16 02:46:42 +00:00
|
|
|
fi
|
|
|
|
|
1998-10-22 07:47:41 +00:00
|
|
|
@@ -84,9 +44,6 @@
|
|
|
|
fi
|
1998-09-06 19:58:26 +00:00
|
|
|
fi
|
1998-03-16 02:46:42 +00:00
|
|
|
|
1998-09-06 19:58:26 +00:00
|
|
|
-# 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
|
1998-10-22 07:47:41 +00:00
|
|
|
@@ -142,10 +99,7 @@
|
1998-09-06 19:58:26 +00:00
|
|
|
then
|
1998-10-22 07:47:41 +00:00
|
|
|
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
|
1998-09-06 19:58:26 +00:00
|
|
|
fi
|
1998-03-16 02:46:42 +00:00
|
|
|
|
1998-10-22 07:47:41 +00:00
|
|
|
@@ -175,9 +129,6 @@
|
1998-09-06 19:58:26 +00:00
|
|
|
# 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');
|
|
|
|
-
|
1998-10-22 07:47:41 +00:00
|
|
|
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');
|
1998-09-06 19:58:26 +00:00
|
|
|
|
1998-10-22 07:47:41 +00:00
|
|
|
@@ -185,6 +136,13 @@
|
1998-09-06 19:58:26 +00:00
|
|
|
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
|
1998-10-22 07:47:41 +00:00
|
|
|
@@ -197,13 +155,6 @@
|
1998-03-16 02:46:42 +00:00
|
|
|
echo
|
|
|
|
echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !"
|
|
|
|
echo
|
1998-10-22 07:47:41 +00:00
|
|
|
- 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
|
1998-09-06 19:58:26 +00:00
|
|
|
echo "You can also try the mysql command line tool with:"
|
|
|
|
echo "@bindir@/mysql test"
|
1998-10-22 07:47:41 +00:00
|
|
|
echo
|