List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:March 22 2001 2:22pm
Subject:Re: question about moving datadir around
View as plain text  
STIBS wrote:
> 
> Hi list!
> 
> I try to change my data dir from the default /var/lib/mysql to /usr/mysql .
> 
> On a standard Suse install I did the following:
> 
> - copying all databases cp -R * /usr/mysql
> - changing the datadir in /etc/my.cnf to /usr/mysql
> - mysql restart
> - works fine
> 
> On my ded. server I have RedHat 7 running, I installed the downloaded
> 3.23.32 rpm and now I tried to move the datadir.
> 
> My steps on RedHat:
> 
> - copying all databases cp -R * /usr/mysql
> - there is no my.cnf in standard install, so I changed in the start script
> /etc/rc.d/init.d/mysql the line $datadir=/usr/mysql
> - mysql restart
> -> demon gives up with the following statement in error log: "Can't find
> ./mysql/host.frm"
> but the file is there, also chowned to mysql:mysql ...
> 
> next thing I did was setting up a symlink in /usr/mysql to the
> /var/lib/mysql/mysql directory ... that the demon gets the original data ...
> same comment in error log.
> 
> Do you have a solution or a step by step manual for me?
> 
> Any help is appreciated.
> 
> Thanx alot!
> Michael
> 
>

When you copied the database, you probably did it as root.
Now mysql doe not own the directories and data.

chown -R mysql /usr/mysql
Thread
question about moving datadir aroundSTIBS21 Mar
  • Re: question about moving datadir aroundGerald Clark22 Mar