Description:
Hi,
(In 4.0/4.1/5.0)
When running multiple versions, it's nice to be able to use --defaults-file.
./bin/mysql_fix_privilege_tables --defaults-file=/var/mysql/50/my.cnf
The --defaults-file= is handled and used, but not when calling the mysql program.
Also, wrong mysql client is used. My installation is in /usr/local/mysql-50/ :)
Regards,
Geert
How to repeat:
./bin/mysql_fix_privilege_tables --defaults-file=/var/mysql/50/my.cnf --verbose
The $cmd variables will not use the --defaults-file, but allways --no-defaults. Also, /usr/local/mysql/bin/mysql will mostly be used.
Suggested fix:
A bit like mysql_config:
get_full_path ()
{
if [ -h $1 ];
then
echo `ls -l $1 | awk '{ print $NF }'`
else
case $1 in
/*) echo "$1";;
./*) tmp=`pwd`/$1; echo $tmp | sed -e 's;/\./;/;' ;;
*) which $1 ;;
esac
fi
}
me=`get_full_path $0`
basedir=`echo $me | sed -e 's;/bin/mysql_fix_privilege_tables;;'`
# Find where 'mysql' command is located
if test -z "$bindir"
then
for i in $basedir/bin ./bin ../bin/ /usr/local/mysql/bin client
do
if test -f $i/mysql
then
bindir=$i
break
fi
done
fi
cmd="$bindir/mysql $defaults --force --user=$user --host=$host"