SELinux, MySQL, and this error…

If you see this after changing your mysql init script :

SELinux is preventing /usr/sbin/httpd from connectto access on the unix_stream_socket /var/lib/mysql/mysql.sock

Then you might need to do this :

restorecon /etc/init.d/mysql

to make this:

-rwxr-xr-x. root root unconfined_u:object_r:etc_t:s0 mysql

look like this

-rwxr-xr-x. root root unconfined_u:object_r:initrc_exec_t:s0 mysql

and wrap up with a mysql service restart.

Just a quick observation that might help a lost google searcher find his way. Enjoy and STOP DISABLING SELINUX!

Leave a Reply