Commit 0ed892f1 authored by jimw@mysql.com's avatar jimw@mysql.com

Change mysqld_safe search for mysqld relative to the current working directory

to only look for the mysqld binary (and english error strings) and assume the
datadir from that. Then, if that datadir turns out to not exist, startup will
fail. This avoids the behavior where mysqld_safe would go off and run a totally
different binary because the data directory had been moved (even when --datadir
was specified on the command line). (Bug #7249)
parent 9740ca62
...@@ -86,7 +86,7 @@ parse_arguments() { ...@@ -86,7 +86,7 @@ parse_arguments() {
MY_PWD=`pwd` MY_PWD=`pwd`
# Check if we are starting this relative (for the binary release) # Check if we are starting this relative (for the binary release)
if test -d $MY_PWD/data/mysql -a -f ./share/mysql/english/errmsg.sys -a \ if test -f ./share/mysql/english/errmsg.sys -a \
-x ./bin/mysqld -x ./bin/mysqld
then then
MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are
...@@ -97,7 +97,7 @@ then ...@@ -97,7 +97,7 @@ then
defaults="--defaults-extra-file=$MY_BASEDIR_VERSION/data/my.cnf" defaults="--defaults-extra-file=$MY_BASEDIR_VERSION/data/my.cnf"
fi fi
# Check if this is a 'moved install directory' # Check if this is a 'moved install directory'
elif test -f ./var/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ elif test -f ./share/mysql/english/errmsg.sys -a \
-x ./libexec/mysqld -x ./libexec/mysqld
then then
MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment