summaryrefslogtreecommitdiff
path: root/scripts/mysql_fix_privilege_tables.sh
diff options
context:
space:
mode:
authorunknown <anozdrin@mysql.com>2005-10-05 01:08:22 +0400
committerunknown <anozdrin@mysql.com>2005-10-05 01:08:22 +0400
commit625c9582e2f3ba8b63c86561da02e5d1e7621586 (patch)
treec0c4a0e730f043e215f0e06e22cd34c79837ff42 /scripts/mysql_fix_privilege_tables.sh
parentef16a0416007ce940f4e9e12462b78c09797b1bd (diff)
downloadmariadb-git-625c9582e2f3ba8b63c86561da02e5d1e7621586.tar.gz
Make mysql_fix_privilege_tables.sh not dependent on the current directory.
scripts/mysql_fix_privilege_tables.sh: Make the script not dependent on the current directory.
Diffstat (limited to 'scripts/mysql_fix_privilege_tables.sh')
-rw-r--r--scripts/mysql_fix_privilege_tables.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh
index d080b68b268..073964d4bde 100644
--- a/scripts/mysql_fix_privilege_tables.sh
+++ b/scripts/mysql_fix_privilege_tables.sh
@@ -97,9 +97,11 @@ fi
# Find where 'mysql' command is located
+dirname=`dirname "$0"`
+
if test -z "$bindir"
then
- for i in @bindir@ $basedir/bin client
+ for i in @bindir@ $basedir/bin "$dirname/../client"
do
if test -f $i/mysql
then
@@ -109,6 +111,13 @@ then
done
fi
+if test -z "$bindir"
+then
+ echo "Could not find MySQL command-line client (mysql)."
+ echo "Please use --basedir to specify the directory where MySQL is installed."
+ exit 1
+fi
+
cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host"
if test ! -z "$password" ; then
cmd="$cmd --password=$password"
@@ -128,7 +137,7 @@ fi
# Find where first mysql_fix_privilege_tables.sql is located
for i in $basedir/support-files $basedir/share $basedir/share/mysql \
- $basedir/scripts $pkgdatadir . ./scripts
+ $basedir/scripts $pkgdatadir . "$dirname"
do
if test -f $i/$file
then