Bug #4659 | Some client programs only look in /usr/local/mysql/bin/ for binaries | ||
---|---|---|---|
Submitted: | 20 Jul 2004 22:05 | Modified: | 3 Aug 2004 17:57 |
Reporter: | philip antoniades | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Command-line Clients | Severity: | S3 (Non-critical) |
Version: | 4.1.3 | OS: | Linux (Linux) |
Assigned to: | Matthias Leich | CPU Architecture: | Any |
[20 Jul 2004 22:05]
philip antoniades
[23 Jul 2004 4:38]
Matthew Lord
mysqld_safe takes the --basedir option which allows you to run it from wherever and specify a different location that the compiled default. mysqlaccess, however, has hardcoded paths to /usr/local/mysql/bin/mysql and /usr/local/mysql/ bin/mysqldump and it does not process a --basedir option.
[28 Jul 2004 19:12]
Matthew Lord
mysqld_safe takes the basedir option but it doesn't use it to determine where mysqld is! MY_PWD=`pwd` # 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 \ -x ./bin/mysqld then MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is DATADIR=$MY_BASEDIR_VERSION/data if test -z "$defaults" then defaults="--defaults-extra-file=$MY_BASEDIR_VERSION/data/my.cnf" fi # Check if this is a 'moved install directory' elif test -f ./var/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ -x ./libexec/mysqld then MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is DATADIR=$MY_BASEDIR_VERSION/var else MY_BASEDIR_VERSION=/usr/local/mysql DATADIR=/usr/local/mysql/var ledir=/usr/local/mysql/libexec fi We need to use the passed in basedir which is assigned to MY_BASEDIR_VERSION if it has a value.
[3 Aug 2004 17:57]
Matthias Leich
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.mysql.com/documentation/ and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php Additional info: Thank you for taking the time to write to us, but this is not a bug. 1. The report seems to be basically a description of the current behaviour if somebody moves a binary installation (configured and compiled for installation in /usr/local/mysql) to another destination. It is possible to avoid some of the problems caused by such a move via tricky use of the command line options and option files, but not all tools have such options. I would say the software works as intended/designed, but I also believe that the current properties do not fit to the needs of certain customers. It would be nice if our software had a global and convenient solution for such cases, because not all customers are able to install the software at default places like /usr/local/mysql . So your suggested fix is a big change request and should be thoroughly discussed, because it affects nearly all binaries and scripts. 2. The "mysqld_safe --basedir=.." problem The software works as designed, because - the manual says in "5.1.3 The mysqld_safe Server Startup Script" mysqld_safe expects one of the following conditions to be true: * The server and databases can be found relative to the directory from which mysqld_safe is invoked. .... This condition should be met if you execute mysqld_safe from your MySQL installation directory (for example, `/usr/local/mysql' for a binary distribution). * If the server and databases cannot be found relative to the working directory, mysqld_safe attempts to locate them by absolute pathnames. .... The actual locations are determined from the values configured into the distribution at the time it was built. They should be correct if MySQL is installed in the location specified at configuration time. "mysqld_safe" treats the "--basedir=.." option as an argument which should be only passed to the starting server as option. (There is a comment within the mysqld_safe script that --basedir and some other options get passed explicitly to mysqld). So the current mysqld_safe behaviour is similar to mysqld. Example: cd <BASEDIR1> ; libexec/mysqld --basedir=<BASEDIR2> or cd <BASEDIR1> ; libexec/mysqld with option file containing <BASEDIR2> will execute the binary <BASEDIR1>/libexec/mysqld for the server. The only effect is that the server will look into <BASEDIR2> if he needs some additional stuff for his work. I can modify "mysqld_safe" so, that if a basedir is assigned via command line parameter or option file all stuff( binaries etc.) will be taken from that assigned basedir. May be it will help some customers a little bit, but I have deep doubts - It is an absolute incompatible change of the semantics. Other customers may depend on the old semantics of "mysqld_safe". - The semantics of "mysqld_safe" and "mysqld" with assigned basedir would then differ !! - It provides no solution for the moved installation directory related problems of other binaries and scripts. - I assume there will be only low or no acceptance for such an incomplete solution if I take into account the new problems created. These disadvantages are too big. Please excuse that I can give only a everything works as intended answer without solving your obvious problems.