diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-07-14 12:57:22 +0300 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-07-14 12:57:22 +0300 |
commit | 35dcc1308257dcbfc975174b76e0856e1d897071 (patch) | |
tree | cee113b603d6b9ce1ba273257a980c8f82c55a2b /scripts | |
parent | 985017674f141bd9fd9c02de7d2cfb7d66aa9117 (diff) | |
parent | 0f3493a490fbd903cb3f13719c1091e02925b70b (diff) | |
download | mariadb-git-35dcc1308257dcbfc975174b76e0856e1d897071.tar.gz |
merge
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/mysql_secure_installation.sh | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh index 25d6343ee2c..188cd030dba 100644 --- a/scripts/mysql_secure_installation.sh +++ b/scripts/mysql_secure_installation.sh @@ -17,6 +17,7 @@ config=".my.cnf.$$" command=".mysql.$$" +mysql_client="" trap "interrupt" 2 @@ -37,10 +38,26 @@ prepare() { chmod 600 $config $command } +find_mysql_client() +{ + for n in ./bin/mysql mysql + do + $n --no-defaults --help > /dev/null 2>&1 + status=$? + if test $status -eq 0 + then + mysql_client=$n + return + fi + done + echo "Can't find a 'mysql' client in PATH or ./bin" + exit 1 +} + do_query() { echo "$1" >$command #sed 's,^,> ,' < $command # Debugging - mysql --defaults-file=$config <$command + $mysql_client --defaults-file=$config <$command return $? } @@ -204,6 +221,7 @@ cleanup() { # The actual script starts here prepare +find_mysql_client set_echo_compat echo |