AppArmor
If AppArmor is running, and mysql or apache2 data directories are other as the default, this must be changed in the apparmor config too.
See https://askubuntu.com/questions/916009/mysql-wont-start-because-of-apparmor
SELinux enabled
The sestatus
command provides a configurable view into the status of SELinux. The simplest form of this command shows the following information:
...