1998-09-06 19:58:26 +00:00
|
|
|
--- scripts/mysql_install_db.sh.orig Mon Aug 17 23:09:45 1998
|
|
|
|
+++ scripts/mysql_install_db.sh Tue Sep 1 15:38:03 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
|
|
|
|
-# It should be run from the top level installation directory
|
|
|
|
#
|
|
|
|
# All arguments to this script is passed to safe_mysqld
|
|
|
|
|
1998-09-06 19:58:26 +00:00
|
|
|
@@ -16,40 +15,12 @@
|
|
|
|
bn=`basename $file .frm-new`
|
|
|
|
mv $file $dir/$bn.frm
|
|
|
|
done
|
|
|
|
-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
|
|
|
|
fi
|
1998-08-14 12:05:42 +00:00
|
|
|
|
1998-03-16 02:46:42 +00:00
|
|
|
if test ! -x @bindir@/mysqladmin
|
|
|
|
then
|
|
|
|
- if test "@localstatedir@" = "./data"
|
|
|
|
- then
|
1998-09-06 19:58:26 +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'"
|
|
|
|
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-03-16 02:46:42 +00:00
|
|
|
- fi
|
|
|
|
fi
|
|
|
|
|
1998-08-14 12:05:42 +00:00
|
|
|
if test -f @localstatedir@/mysql/db.ISM
|
1998-09-06 19:58:26 +00:00
|
|
|
@@ -65,9 +36,6 @@
|
|
|
|
exit 1
|
|
|
|
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
|
|
|
|
@@ -118,10 +86,7 @@
|
1998-03-16 02:46:42 +00:00
|
|
|
#
|
1998-09-06 19:58:26 +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 @pkgdatadir@/mysql/*.frm @localstatedir@/mysql
|
|
|
|
fi
|
1998-03-16 02:46:42 +00:00
|
|
|
|
|
|
|
@bindir@/mysql mysql <<END_OF_DATA
|
1998-09-06 19:58:26 +00:00
|
|
|
@@ -150,9 +115,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');
|
|
|
|
-
|
|
|
|
INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
|
|
|
|
INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
|
|
|
|
|
|
|
|
@@ -160,16 +122,19 @@
|
|
|
|
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
|
|
|
|
echo "mysqld demon is running and mysql grant tables are installed."
|
1998-03-16 02:46:42 +00:00
|
|
|
echo
|
|
|
|
echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !"
|
1998-09-06 19:58:26 +00:00
|
|
|
- echo
|
1998-03-16 02:46:42 +00:00
|
|
|
- echo "You can test the MySQL demon with the benchmarks in the 'bench'"
|
|
|
|
- echo "directory:"
|
|
|
|
- echo "cd bench ; run-all-tests"
|
|
|
|
echo
|
1998-09-06 19:58:26 +00:00
|
|
|
echo "You can also try the mysql command line tool with:"
|
|
|
|
echo "@bindir@/mysql test"
|