summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-03-19 17:37:36 +0100
committerunknown <serg@serg.mylan>2004-03-19 17:37:36 +0100
commit137935dbe4873b5a0677c5ea79a411f5b6c05fc8 (patch)
treeea0cf288eb3b127fc80a98b29025d02e07dd1bc5 /scripts
parentc5f2beead0975539a33930c00fbf6ffa6bb20b68 (diff)
parent02dbb9adf356d2db31d6024c6a4bf300612ce0d7 (diff)
downloadmariadb-git-137935dbe4873b5a0677c5ea79a411f5b6c05fc8.tar.gz
Merge bk-internal:/home/bk/mysql-4.0/
into serg.mylan:/usr/home/serg/Abk/mysql-4.0
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysql_fix_privilege_tables.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh
index 5e3e4210aa4..1dac3ebc725 100644
--- a/scripts/mysql_fix_privilege_tables.sh
+++ b/scripts/mysql_fix_privilege_tables.sh
@@ -32,13 +32,23 @@
# --password=<password>
# --database=<database>
-root_password="$1"
+root_password=""
host="localhost"
user="root"
port=""
socket=""
comment=""
database="mysql"
+bindir="@bindir@"
+
+# Old format where there is only one argument and it's the password
+if test "$#" == 1
+then
+ case "$1" in
+ --*) ;;
+ *) root_password="$1" ; shift ;;
+ esac
+fi
# read all the options
parse_arguments()
@@ -52,6 +62,7 @@ parse_arguments()
--socket=*) socket=`echo "$arg" | sed -e "s;--socket=;;"` ;;
--password=*) root_password=`echo "$arg" | sed -e "s;--password=;;"` ;;
--database=*) database=`echo "$arg" | sed -e "s;--database=;;"` ;;
+ --bindir=*) bindir=`echo "$arg" | sed -e "s;--bindir=;;"` ;;
*)
echo "Unknown argument '$arg'"
exit 1
@@ -63,7 +74,7 @@ parse_arguments()
parse_arguments "$@"
if test -z "$cmd"; then
- cmd="@bindir@/mysql -f --user=$user --host=$host"
+ cmd="$bindir/mysql -f --user=$user --host=$host"
if test ! -z "$root_password"; then
cmd="$cmd --password=$root_password"
fi