Ce contenu n'est pas disponible dans la langue sélectionnée.

Chapter 20. MariaDB (a replacement for MySQL)


The MariaDB database is a multi-user, multi-threaded SQL database server that consists of the MariaDB server daemon (mysqld) and many client programs and libraries.[18]
In Red Hat Enterprise Linux, the mariadb-server package provides MariaDB. Enter the following command to see if the mariadb-server package is installed:
~]$ rpm -q mariadb-server
package mariadb-server is not installed
Copy to Clipboard Toggle word wrap
If it is not installed, use the yum utility as root to install it:
~]# yum install mariadb-server
Copy to Clipboard Toggle word wrap

20.1. MariaDB and SELinux

When MariaDB is enabled, it runs confined by default. Confined processes run in their own domains, and are separated from other confined processes. If a confined process is compromised by an attacker, depending on SELinux policy configuration, an attacker's access to resources and the possible damage they can do is limited. The following example demonstrates the MariaDB processes running in their own domain. This example assumes the mariadb-server package is installed:
  1. Run the getenforce command to confirm SELinux is running in enforcing mode:
    ~]$ getenforce
    Enforcing
    
    Copy to Clipboard Toggle word wrap
    The command returns Enforcing when SELinux is running in enforcing mode.
  2. Enter the following command as the root user to start mariadb:
    ~]# systemctl start mariadb.service
    Copy to Clipboard Toggle word wrap
    Confirm that the service is running. The output should include the information below (only the time stamp will differ):
    ~]# systemctl status mariadb.service
    mariadb.service - MariaDB database server
       Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled)
       Active: active (running) since Mon 2013-08-05 11:20:11 CEST; 3h 28min ago
    
    Copy to Clipboard Toggle word wrap
  3. Enter the following command to view the mysqld processes:
    ~]$ ps -eZ | grep mysqld
    system_u:system_r:mysqld_safe_t:s0 12831 ?     00:00:00 mysqld_safe
    system_u:system_r:mysqld_t:s0   13014 ?        00:00:00 mysqld
    
    Copy to Clipboard Toggle word wrap
    The SELinux context associated with the mysqld processes is system_u:system_r:mysqld_t:s0. The second last 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.


[18] See the MariaDB project page for more information.
Retour au début
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2025 Red Hat