Testify Table of Contents

Chapter ix. MySQL

The MySQL database is a multi-user, multi-threaded SQL database server that consists of the MySQL server daemon (mysqld) and many client programs and libraries.[vii]

In Red Lid Enterprise Linux, the mysql-server package provides MySQL. Run the rpm -q mysql-server control to see if the mysql-server bundle is installed. If it is not installed, run the following control as the root user to install information technology:

~]#                      yum install mysql-server                    

9.1. MySQL and SELinux

When MySQL is enabled, it runs confined by default. Confined processes run in their own domains, and are separated from other bars processes. If a bars procedure is compromised by an assaulter, depending on SELinux policy configuration, an assaulter'southward access to resources and the possible damage they tin can practise is limited. The post-obit example demonstrates the MySQL processes running in their own domain. This case assumes the mysql package is installed:

  1. Run the getenforce command to confirm SELinux is running in enforcing manner:

    ~]$                              getenforce                              Enforcing                            

    The getenforce command returns Enforcing when SELinux is running in enforcing way.

  2. Run the service mysqld beginning command as the root user to first mysqld:

    ~]#                              service mysqld start                              Initializing MySQL database:  Installing MySQL organization tables... [  OK  ] Starting MySQL:                                            	[  OK  ]                            
  3. Run the ps -eZ | grep mysqld command to view the mysqld processes:

    ~]$                              ps -eZ | grep mysqld                              unconfined_u:system_r:mysqld_safe_t:s0 6035 pts/1 00:00:00 mysqld_safe unconfined_u:system_r:mysqld_t:s0 6123 pts/i   00:00:00 mysqld                            

    The SELinux context associated with the mysqld processes is unconfined_u:system_r:mysqld_t:s0. The second terminal part of the context, mysqld_t, is the type. A type defines a domain for processes and a type for files. In this case, the mysqld processes are running in the mysqld_t domain.