summaryrefslogtreecommitdiff
path: root/scripts/mysql_fix_privilege_tables.sh
diff options
context:
space:
mode:
authorunknown <lenz@mysql.com>2003-04-09 21:19:53 +0200
committerunknown <lenz@mysql.com>2003-04-09 21:19:53 +0200
commit0606f5bb1b4c98b77e10b934d3c1b71b5eaa9b36 (patch)
tree792e89c97fe0b26a4ce275ca21584bf2250fcfe9 /scripts/mysql_fix_privilege_tables.sh
parent1bdf0851599fc6de78030903e09eb043839d2af8 (diff)
downloadmariadb-git-0606f5bb1b4c98b77e10b934d3c1b71b5eaa9b36.tar.gz
- applied patch from provided by Christian Hammers from Debian to be able
to run the script even if mysqld is not up and running on upgrade scripts/mysql_fix_privilege_tables.sh: - applied Patch provided by Christian Hammers from Debian to be able to run this script on every upgrade without having to worry that the server is really running. Therefore "mysqld --bootstrap" is used to make the changes. For this to work all SQL statements are sent to stderr when "--sqlonly" is given and the echo's are piped to /dev/null. The echo_stderr that is used is just a "#!/bin/sh\necho "$*" >&2" script.
Diffstat (limited to 'scripts/mysql_fix_privilege_tables.sh')
-rw-r--r--scripts/mysql_fix_privilege_tables.sh24
1 files changed, 15 insertions, 9 deletions
diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh
index 09259779855..526b7ac91b3 100644
--- a/scripts/mysql_fix_privilege_tables.sh
+++ b/scripts/mysql_fix_privilege_tables.sh
@@ -1,14 +1,5 @@
#!/bin/sh
-echo "This scripts updates the mysql.user, mysql.db, mysql.host and the"
-echo "mysql.func tables to MySQL 3.22.14 and above."
-echo ""
-echo "This is needed if you want to use the new GRANT functions,"
-echo "CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 3.23"
-echo ""
-echo "If you get 'Access denied' errors, you should run this script again"
-echo "and give the MySQL root user password as an argument!"
-
root_password="$1"
host="localhost"
user="root"
@@ -20,6 +11,21 @@ else
cmd="@bindir@/mysql -f --user=$user --password=$root_password --host=$host mysql"
fi
+# Debian addition
+if [ "$1" = "--sql-only" ]; then
+ root_password=""
+ cmd="/usr/share/mysql/echo_stderr"
+fi
+
+echo "This scripts updates the mysql.user, mysql.db, mysql.host and the"
+echo "mysql.func tables to MySQL 3.22.14 and above."
+echo ""
+echo "This is needed if you want to use the new GRANT functions,"
+echo "CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 3.23"
+echo ""
+echo "If you get 'Access denied' errors, you should run this script again"
+echo "and give the MySQL root user password as an argument!"
+
echo "Converting all privilege tables to MyISAM format"
$cmd <<END_OF_DATA
ALTER TABLE user type=MyISAM;