SE Linux allowing Mysql Socket

So this morning my mysql server did not start properly. But when I disabled selinux the mysql server come back up. After some digging i found that we have linked the mysql folder /var/lib/mysql from the /var/log disk (its my syslog server and /var/log has all the disk) So for starting my mysql I hade to do some small changers. First setting my socket to the right path i my.cnf

socket=/var/log/mysql/mysql.sock

Then allowing mysql to use that path in selinux

semanage fcontext -a -t mysqld_db_t "/var/log/mysql(/.*)?"

and applying the change

restorecon -Rv /var/log/mysql/

And finaly then i can start the mysql server again

service mysqld start

And now the logs are again comming into my mysql server.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: