I am reinstalling linux Centos 6 to have the OS on an SSD. In the process Ihave moved my MySQL data directory onto a HDD, made the necessary modifications to my.cnf and now SELinux is preventing mySQL from starting.
I have discovered a workaround for this so I'm asking this forum for a proper fix.
The typical fix for this, to set a new SELinux context for the new data directory location isn't working. I believe it has something to do with the full path of the data directory not satisfying SELinux because I can get it to work using the command below:
As instructed:
semanage fcontext -a -t mysqld_db_t "/mnt/HDD0/DBData/mysql(/.*)?" -> MySQL can't start
Temporary work around:
semanage fcontext -a -t mysqld_db_t "/mnt(/.*)?" -> MySQL can start.
It is a requirement for me to put the data directory in /mnt/HDD0/DBData/.
I'd like to do this properly. I am currently reading the Red Hat SELinux manual, and I am finding it daunting.
Notes:
I am using Centos 6.4, MySQL 5.6, and.
I have followed the instructions on both of the following.
https://blogs.oracle.com/jsmyth/entry/selinux_and_mysql
https://access.redhat.com/documentat..._Examples.html