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.lo wer-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
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.lo
/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
ASKER
Yeap tried the chown -R mysql as well
its mounted with fstab
its mounted with fstab
what user are you starting mysql with?
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?
ASKER
I assume root, how ever fedora 6 sets it up..I'll have to check
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
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 &
?
shell> mysqld_safe &
?
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.
if I set SELinux to permissive then every thing works. so i'm going to start playing with these settings.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.