Chapter 17. Database Servers
This chapter guides you through the installation and configuration of the MariaDB server, which is an open source fast and robust database server that is based on MySQL technology. The chapter also describes how to back up MariaDB data.
MariaDB is a relational database which converts data into structured information and provides an SQL interface for accessing data. It includes multiple storage engines and plug-ins, as well as geographic information system (GIS).
Red Hat Enterprise Linux 7 contains MariaDB 5.5 as the default implementation of a server from the MySQL databases family. Later versions of the MariaDB database server are available as Software Collections for Red Hat Enterprise Linux 6 and Red Hat Enterprise Linux 7. For more information about the latest versions, see the Release Notes for Red Hat Software Collections.
17.1.1. Installing the MariaDB server
To install the MariaDB server, follow this procedure:
Installing the MariaDB server
Ensure that the mariadb and mariadb-server packages are installed on the required server:
~]# yum install mariadb mariadb-server
~]# systemctl start mariadb.service
mariadbservice to start at boot:
~]# systemctl enable mariadb.service
184.108.40.206. Improving MariaDB installation security
You can improve security when installing the MariaDB server by running the
This command launches a fully interactive script, which prompts for each step in the process. The script enables to improve security in the following ways:
- Setting a password for root accounts
- Removing anonymous users
- Disallowing remote (outside the local host) root logins
- Removing test database
17.1.2. Configuring the MariaDB server for networking
To configure the MariaDB server for networking, use the
[mysqld] section of the
/etc/my.cnf.d/server.cnf file, where you can set the following configuration directives:
Bind-address is the address on which the server will listen.
Possible options are: a host name, an IPv4 address, or an IPv6 address.
Possible values are:
0 - to listen for all clients
1 - to listen for local clients only
The port on which MariaDB listens for TCP/IP connections.
17.1.3. Backing up MariaDB data
There are two main ways to back up data from a MariaDB database:
- Logical backup
- Physical backup
220.127.116.11. Logical back up
Logical backup consists of the SQL statements necessary to restore the data. This type of backup exports information and records in plain text files.
The main advantage of logical backup over physical backup is portability and flexibility. The data can be restored on other hardware configurations, MariaDB versions or Database Management System (DBMS), which is not possible with physical backups.
Logical backup can be performed only if the
mariadb.service is running. Logical backup does not include log and configuration files.
18.104.22.168. Physical back up
Physical backup consists of copies of files and directories that store the content.
Physical backup has the following advantages compared to logical backup:
- Output is more compact.
- Backup is smaller in size.
- Backup and restore are faster.
- Backup includes log and configuration files.
Physical backup must be performed when the mariadb.service is not running or all tables in the database are locked to prevent changes during the backup.