modules use SELinux contexts to define rules for how processes, files, ports, and other system objects interact with each other. Interaction between system objects is only permitted if a policy rule allows it. An SELinux context (the label applied to a system object) has the following fields:  user ,  role ,  type , and security level . Type information rather than the entire SELinux context is used most commonly to define rules for how processes interact with other system objects. MySQL SELinux policy modules, for example, define policy rules using  type  information. You can view SELinux contexts using operating system commands such as  ls  and  ps  with the  -Z  option. Assuming that SELinux is enabled and a MySQL Server is running, the following commands show the SELinux context for the  mysqld  process and MySQL data directory: Check if SELinux is Enabled mysqld  process: MySQL data directory: shell>  ps -eZ | grep mysqld system_u:system_r:mysqld_t:s0 5924 ? 00:00:03 mysqld shell>  cd /var/lib shell>  ls -Z | grep mysql system_u:object_r:mysqld_db_t:s0 mysql • system_u  is an SELinux user identity for system processes and objects. • system_r  is an SELinux role used for system processes. • objects_r  is an SELinux role used for system objects. • mysqld_t  is the type associated with the mysqld process. • mysqld_db_t  is the type associated with the MySQL data directory and its files. • s0  is the security level. where: For more information about interpreting SELinux contexts, refer to your distribution’s SELinux documentation. SELinux is enabled by default on some Linux distributions including Oracle Linux, RHEL, CentOS, and Fedora. Use the  sestatus  command to determine if SELinux is enabled on your distribution: If SELinux is disabled or the  sestatus  command is not found, refer to your distribution’s SELinux documentation for guidance before enabling SELinux. shell>  sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: enforcing Mode from config file: enforcing Policy MLS status: enabled Policy deny_unknown status: allowed Memory protection checking: actual (secure) Max kernel policy version: 31 6.7.1 Check if SELinux is Enabled 1602