Mysqld won't start with Selinux enforcing turned on
Guys,
I changed the default data location for mysql. Modified my.cnf on /etc. Give mysql access to the new directory and moved the databases over. Everything works fine. But when I turn selinux to 'enforcing', mysqld won't start. How do I workaround this and be able to still have selinux be in 'enforcing' mode Thanks in advance. John |
The context for the directory has to be correct, so for example
Quote:
|
Billymayday,
I finally got around to try it but I don't have any luck. Getting "Timeout error occurred trying to start MySQL Daemon." selinux is off [root@centos53a ~]# ls -dZ /var/lib/mysql drwxr-xr-x mysql mysql system_u:object_r:mysqld_db_t:s0 /var/lib/mysql [root@centos53a ~]# ls -dZ /u03 drwxr-xr-x mysql mysql /u03 *** I did the command you suggested below, /u03 is the new location of mysql in my.cnf file *** [root@centos53a ~]# chcon system_u:object_r:mysqld_db_t:s0 /u03 [root@centos53a ~]# ls -dZ /u03 drwxr-xr-x mysql mysql system_u:object_r:mysqld_db_t:s0 /u03 selinux is on reboot *** after reboot, it shows the following*** [root@centos53a /]# ls -dZ /var/lib/mysql drwxr-xr-x mysql mysql system_u:object_r:mysqld_db_t /var/lib/mysql [root@centos53a /]# ls -dZ /u03 drwxr-xr-x mysql mysql system_u:object_r:mysqld_db_t /u03 -John |
Quote:
Finally got it to work with the following: chcon -Rv --type=system_u:object_r:mysqld_db_t my_new_dir I just needed to give both the files and directory access. Thanks again. John |
All times are GMT -5. The time now is 12:06 AM. |