On Apr 9, 2005, at 6:50 AM, Jeff Drew wrote:
Can the the datadir be changed with a .rpm install on SuSE?
Yes, sort of.
Our SA gave us a large partition on /export. We installed the .rpm and were running fine with the datadir set to the default /var/lib path. So I need to move the datadir to /export. Since we're just moving to Production, we do not need the data currently residing on /var/lib. Going forward, we need to read/write to /export.
When you say, "datadir set to the default /var/lib path", you mean /var/lib/mysql, right?
I have not been able to get mysql running with the datadir set to /export. I read in the documentation that the datadir is set at build time for some distributions, but it also explains how to change the datadir in my.cnf, etc so I'm confused.
To move datadir to /export, I:
1. Changed the datadir parameter to /export in the /etc/my.cnf file
2. Reran mysql_database_install script.
3. Verified that all the appropriate files and directories appear to have installed under /export.
However, the mysqld_safe script says it's: - using /export for data - using a .pid file in /export - exits without starting mysql. There are no other error messages.
Is there a .err file in /export or /var/lib/mysql? That should contain the error message(s).
Can datadir be set to /export successfully? If yes, is there some other configuration that needs to be changed?
Thanks
Jeff
Currently, mysqld_safe has some problems dealing with a moved data directory. (See bug #7249 <http://bugs.mysql.com/bug.php?id=7249>, for example.) One aspect of this problem is that mysqld_safe will not read the server-specific option file, datadir/my.cnf if datadir has been moved, but it *will* read the option file in the default location (/var/lib/mysql/my.cnf, in your case), even though that's not your datadir! As the server-specific option file is read after the global file, /etc/my.cnf, one possibility is that old settings in /var/lib/mysql/my.cnf are overriding your new settings in /etc/my.cnf.
It should be possible to make this work, though. Your best bet is to make the new datadir appear to be in the default location.
First, if you've been given the entire /export partition for your datadir, why not simply mount that partition as /var/lib/mysql instead of /export? If you can do that, then you won't have to mess with anything else. If you've been given a subdirectory of the /export partition, that's not an option, of course.
If you cannot mount /export as /var/lib/mysql, or datadir is really a subdirectory of /export, I recommend that you replace /var/lib/mysql with a symbolic link to your new datadir.
Either way, datadir should be owned by user mysql, group mysql, with permissions set to 700 (or perhaps 750). If mysqld is dying immediately without leaving a .err file, it most likely didn't have permission to write to datadir.
If that's not enough to get you going, please provide the exact command you use to invoke mysqld_safe, and paste its actual output in your reply.
Michael
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]