> At 4:22 PM -0400 9/19/03, Jeff McKeon wrote: > >We've got mysql 3.23 installed on a redhat system via the rpm's that > >come with RedHat 8.0. I'd like to change the default data > directory so > >something other than /var/lib/mysql. I know this is supposed to be > >possible with a start switch of --datadir=/path/to/data but > it doesn't > >seem to work. > > It should work. >
Perhaps I'm putting the switch in incorrectly then because when I do... /etc/init.d/mysqld --datadir=/path/to/data And then do... Mysqladmin variables The output says the data directory is the default /var/lib/mysql/ > > > >The startup of mysql uses the /etc/init.d/mysqld script so I suppose > >I'll need to change something in that and add the switch, I > just can't > >seem to figure out where. > > I wouldn't change the script, it'll get overwritten if you upgrade. > > You might try editing /etc/my.cnf (create it if it doesn't > exist) and add this to it: > > [mysqld] > datadir=/path/to/data > This I tried and the results were that the server didn't start properly... Changed the my.cnf to: [mysqld] datadir=/DATA/mysql/data socket=/var/lib/mysql/mysql.sock [mysql.server] user=mysql basedir=/var/lib [safe_mysqld] err-log=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid Stopped and started mysqld: [EMAIL PROTECTED] root]# /etc/init.d/mysqld stop Stopping MySQL: [ OK ] [EMAIL PROTECTED] root]# /etc/init.d/mysqld start Starting MySQL: [ OK ] [EMAIL PROTECTED] root]# mysqladmin variables mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)' Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists! > Alternatively, rename /var/lib/mysql to something else (or > remove it....) and recreate /var/lib/mysql as a symlink to > where you really want the data directory. Make sure the > target of the symlink exists. > > > > >Any suggestions? > > > >Thanks, > > > >Jeff > > > -- > Paul DuBois, Senior Technical Writer > Madison, Wisconsin, USA > MySQL AB, www.mysql.com > > Are you MySQL certified? http://www.mysql.com/certification/ > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]