On 03.05.2006 01:21 (+0100), paul rivers wrote:
> Specify the data dir in the local my.cnf and be sure your instance uses it
> by starting it with the --defaults-file parameter set to that instance's
> local copy.
Okay, since hacking seems to be required anyway, I hacked it the
straight-forward and least-change way. I already had datadir=... changed
in the init script to the correct location. Now I also insert some
variables corrections in bin/mysqld_safe:
# here are the lines where ledir is set totally wrong...
MY_BASEDIR_VERSION=`pwd`
ledir=${MY_BASEDIR_VERSION}/bin
DATADIR=`pwd | sed -r "s;/usr/local/;/var/;"`/data
defaults="--defaults-file=${DATADIR}/my.cnf"
# user=... and so on
This does the job pretty well for MySQL 4.0. Need to do it with every
upgrade, but I think I can automate it.
MySQL 5.0 required a less invasive hack though. I saw that setting
datadir= in the proposed init script is for nothing at the very
beginning since it's overwritten again right below. So moving that line
further down helped. Then the mysqld_safe call in the 'start' section
required an additional parameter --defaults-file=$datadir/my.cnf to make
it read my socket name, IP & port etc.
Now both servers are up and running fine again, side by side, with the
*entire* data directory moved somewhere else, saving me from handling
that with every upgrade. Thanks for your help, I thought it could be
done an easy way but it seems nobody has thought about doing that
before. At least I don't have the impression, from reading the scripts.
--
Yves Goergen "LonelyPixel" <[EMAIL PROTECTED]>
http://beta.unclassified.de – My web laboratory.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]