summaryrefslogtreecommitdiff
path: root/databases/mysql323-server/files/patch-ab
blob: 1698b84a1df9e9fe7e481926963ae891c34f0082 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
--- 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