[CentOS] Moving Mysql data directory denied by selinux?
William L. Maltby
CentOS4Bill at triad.rr.com
Tue Oct 10 15:23:15 UTC 2006
On Tue, 2006-10-10 at 23:01 +1000, Peter Kiem wrote:
> Hi Jim,
>
> > > Now normally I just move /var/lib/mysql to /home/mysql and symlink
> > > it.
> >
> > Um... why? This seems like it would be more trouble than it's worth.
> > and with the symlink, I don't see the benefit.
>
> The reason I move it is because I usually make my systems with a 'small'
> / partition (say 10GB) and a large /home partition.
>
> It is very easy to have large MySQL databases sitting in the default
> location then use up all space on the / partition which causes all sorts
> of havoc.
>
> By moving it off to the /home partition it is moved to where the
> majority of the space is available and away from system data. MySQL
> databases are user data and should be in the user area.
>
> The symlink allows you then to just start MySQL without changing any of
> the config files and anything else that expects it to be in
> /var/lib/mysql can still find it.
While you're reading up on the mount command as suggested earlier, keep
an eye open for the fact that you can mount any portion of a directory
structure over another. This will give you the "freedom" to put stuff
in /home and leave the config files and SELinux (? I think, I'm still
total n00b at that) unchanged.
> <snip>
BTW, I agree that user data belongs in a user area, not system area. I
would move it for that reason alone.
HTH
__
Bill
More information about the CentOS
mailing list