Link to home
Start Free TrialLog in
Avatar of ocsurf
ocsurf

asked on

Moving Data Dir

I'm trying to move our datadir but everytime i try to start mysql's service it fails. the error is below. I have tried everyting, coping the dir as root then as mysql user and nothing work.  The /remote/d2 is a external mounted hard drive ( Dell PowerVault 220S ) Any ideas?

my.cnf---
[mysqld]
datadir=/remote/d2/mysql

---msyqld.log----
061112 11:30:03  mysqld started
061112 11:30:03 [Warning] Can't create test file /remote/d2/mysql/backup.lower-test
/usr/libexec/mysqld: Can't change dir to '/remote/d2/mysql/' (Errcode: 13)
061112 11:30:03 [ERROR] Aborting

061112 11:30:03 [Note] /usr/libexec/mysqld: Shutdown complete

061112 11:30:03  mysqld ended
Avatar of VoteyDisciple
VoteyDisciple

That certainly sounds like a simple permissions problem...

Copying the directory as the mysql user ought to do it, but you could try a chown -R mysql * just to be sure.

Which user did the mounting can potentially screw around with that too but if you're seeing that mysql owns everything then there must be more at work than meets the eye.
Avatar of ocsurf

ASKER

Yeap tried the chown -R mysql as well

its mounted with fstab
what user are you starting mysql with?
Avatar of ocsurf

ASKER

I'm running the mysqld service. This is for a web server.
the mysqld service must run under a particular user, which user is that?
Avatar of ocsurf

ASKER

I assume root, how ever fedora 6 sets it up..I'll have to check
Avatar of mbvvsatish
try this

groupadd mysql
useradd -g mysql mysql
chown -R root  /usr/local/mysql
chown -R mysql /usr/local/mysql/data
chgrp -R mysql /usr/local/mysql
Can you start the mysql process with:

shell>  mysqld_safe &

?
Avatar of ocsurf

ASKER

Thanks for you help...but i found the answer.
if I set SELinux to permissive then every thing works. so i'm going to start playing with these settings.
ASKER CERTIFIED SOLUTION
Avatar of CetusMOD
CetusMOD
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial