2
# Copyright (C) 1997-2006 MySQL AB
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; version 2 of the License.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
# This scripts creates the privilege tables db, host, user, tables_priv,
18
# columns_priv in the mysql database, as well as the func table.
20
if [ x$1 = x"--bin" ]; then
28
# Check if it's a binary distribution or a 'make install'
29
if test -x ../libexec/mysqld
32
elif test -x ../../sbin/mysqld # RPM installation
37
libexecdir=../../libexec
52
if [ x$1 = x"-slave" ]
70
if test -x $execdir/mysqld
72
mysqld=$execdir/mysqld
74
if test ! -x $libexecdir/mysqld
76
echo "mysqld is missing - looked in $execdir and in $libexecdir"
79
mysqld=$libexecdir/mysqld
83
# On IRIX hostname is in /usr/bsd so add this to the path
85
hostname=`hostname` # Install this too in the user table
86
hostname="$hostname%" # Fix if not fully qualified hostname
89
#create the directories
90
[ -d $vardir ] || mkdir $vardir
91
[ -d $logdir ] || mkdir $logdir
93
# Create database directories mysql & test
94
if [ -d $data ] ; then rm -rf $data ; fi
95
mkdir $data $data/mysql $data/test
98
if [ x$BINARY_DIST = x1 ] ; then
102
EXTRA_ARG="--windows"
105
INSTALL_CMD="$scriptdir/mysql_install_db --no-defaults $EXTRA_ARG --basedir=$basedir --datadir=mysql-test/$ldata --srcdir=."
106
echo "running $INSTALL_CMD"
113
echo "Error executing mysqld --bootstrap"