All pages
Powered by GitBook
1 of 10

Installing MariaDB RPM Files

Install and manage MariaDB Server using RPM packages. This section provides detailed instructions for deploying and upgrading MariaDB on RPM-based Linux distributions.

About the MariaDB RPM Files

Available RPM Packages

The available RPM packages depend on the specific MariaDB release series.

Available RPM Packages in MariaDB

The following RPMs are available in current versions of MariaDB:

Package Name
Description

galera-4

The WSREP provider for Galera 4.

MariaDB-backup

mariadb-backup

MariaDB-backup-debuginfo

Debuginfo for mariadb-backup

MariaDB-client

Client tools like mariadb CLI, mariadb-dump, and others.

MariaDB-client-debuginfo

Debuginfo for client tools like mariadb CLI, mariadb-dump, and others.

MariaDB-common

Character set files and /etc/my.cnf

MariaDB-common-debuginfo

Debuginfo for character set files and /etc/my.cnf

MariaDB-compat

Old shared client libraries, may be needed by old MariaDB or MySQL clients

MariaDB-connect-engine

The CONNECT storage engine.

MariaDB-connect-engine-debuginfo

Debuginfo for the CONNECT storage engine.

MariaDB-cracklib-password-check

The cracklib_password_check password validation plugin.

MariaDB-cracklib-password-check

Debuginfo for the cracklib_password_check password validation plugin.

MariaDB-devel

Development headers and static libraries.

MariaDB-devel-debuginfo

Debuginfo for development headers and static libraries.

MariaDB-gssapi-server

The gssapi authentication plugin.

MariaDB-gssapi-server-debuginfo

Debuginfo for the gssapi authentication plugin.

MariaDB-rocksdb-engine

The MyRocks storage engine.

MariaDB-rocksdb-engine-debuginfo

Debuginfo for the MyRocks storage engine.

MariaDB-server

The server and server tools, like myisamchk and mariadb-hotcopy are here.

MariaDB-server-compat

Symbolic links from old MySQL tool names to MariaDB, like mysqladmin -> mariadb-admin or mysql -> mariadb. Good to have if you are using MySQL tool names in your scripts.

MariaDB-server-debuginfo

Debuginfo for the server and server tools, like myisamchk and mariadb-hotcopy are here.

MariaDB-shared

Dynamic client libraries.

MariaDB-shared-debuginfo

Debuginfo for dynamic client libraries.

MariaDB-test

mysql-client-test executable, and mysql-test framework with the tests.

MariaDB-test-debuginfo

Debuginfo for mysql-client-test executable, and mysql-test framework with the tests.

MariaDB-tokudb-engine

The TokuDB storage engine.

MariaDB-tokudb-engine-debuginfo

Debuginfo for the TokuDB storage engine.

Installing RPM Packages

Preferably, you should install MariaDB RPM packages using the package manager of your Linux distribution, for example yum orzypper. But you can also use the lower-levelrpm tool.

Actions Performed by RPM Packages

Users and Groups Created

When the MariaDB-server RPM package is installed, it will create a user and group named mysql, if it does not already exist.

See Also

  • Installing MariaDB with yum

This page is licensed: CC BY-SA / Gnu FDL

Checking MariaDB RPM Package Signatures

MariaDB RPM packages since MariaDB 5.1.55 are signed.

The key we use has an id of 1BB943DB and the key fingerprint is:

1993 69E5 404B D5FC 7D2F E43B CBCB 082A 1BB9 43DB

To check the signature you first need to import the public part of the key like so:

gpg --keyserver hkp://pgp.mit.edu --recv-keys 1BB943DB

Next you need to let pgp know about the key like so:

gpg --export --armour 1BB943DB > mariadb-signing-key.asc
sudo rpm --import mariadb-signing-key.asc

You can check to see if the key was imported with:

rpm -qa gpg-pubkey*

Once the key is imported, you can check the signature of the MariaDB RPM files by running the something like the following in your download directory:

rpm --checksig $(find . -name '*.rpm')

The output of the above will look something like this (make sure gpg shows up on each OK line):

me@desktop:~$ rpm --checksig $(find . -name '*.rpm')
./kvm-rpm-centos5-amd64/rpms/MariaDB-test-5.1.55-98.el5.x86_64.rpm: (sha1) dsa sha1 md5 gpg OK
./kvm-rpm-centos5-amd64/rpms/MariaDB-server-5.1.55-98.el5.x86_64.rpm: (sha1) dsa sha1 md5 gpg OK
./kvm-rpm-centos5-amd64/rpms/MariaDB-client-5.1.55-98.el5.x86_64.rpm: (sha1) dsa sha1 md5 gpg OK
./kvm-rpm-centos5-amd64/rpms/MariaDB-shared-5.1.55-98.el5.x86_64.rpm: (sha1) dsa sha1 md5 gpg OK
./kvm-rpm-centos5-amd64/rpms/MariaDB-devel-5.1.55-98.el5.x86_64.rpm: (sha1) dsa sha1 md5 gpg OK
./kvm-rpm-centos5-amd64/rpms/MariaDB-debuginfo-5.1.55-98.el5.x86_64.rpm: (sha1) dsa sha1 md5 gpg OK
./kvm-rpm-centos5-amd64/srpms/MariaDB-5.1.55-98.el5.src.rpm: (sha1) dsa sha1 md5 gpg OK

See Also

  • Installing MariaDB RPM Files

  • Troubleshooting MariaDB Installs on RedHat/CentOS

This page is licensed: CC BY-SA / Gnu FDL

Installing MariaDB With the rpm Tool

This article describes how to download the RPM files and install them using therpm command.

It is highly recommended to Install MariaDB with yum where possible.

Navigate toand choose the desired database version and then select the RPMs that match your Linux distribution and architecture.

Clicking those links takes you to a local mirror. Choose the rpms link and download the desired packages. The packages will be similar to the following:

MariaDB-client-5.2.5-99.el5.x86_64.rpm
MariaDB-debuginfo-5.2.5-99.el5.x86_64.rpm
MariaDB-devel-5.2.5-99.el5.x86_64.rpm
MariaDB-server-5.2.5-99.el5.x86_64.rpm
MariaDB-shared-5.2.5-99.el5.x86_64.rpm
MariaDB-test-5.2.5-99.el5.x86_64.rpm

For a standard server installation you will need to download at least the client, shared, and server RPM files. See About the MariaDB RPM Files for more information about what is included in each RPM package.

After downloading the MariaDB RPM files, you might want to check their signatures. See Checking MariaDB RPM Package Signatures for more information about checking signatures.

rpm --checksig $(find . -name '*.rpm')

Prior to installing MariaDB, be aware that it will conflict with an existing installation of MySQL. To check whether MySQL is already installed, issue the command:

rpm -qa 'mysql*'

If necessary, you can remove found MySQL packages before installing MariaDB.

To install MariaDB, use the command:

rpm -ivh MariaDB-*

You should see output such as the following:

Preparing...                ########################################### [100%]
   1:MariaDB-shared         ########################################### [ 14%]
   2:MariaDB-client         ########################################### [ 29%]
   3:MariaDB-client         ########################################### [ 43%]
   4:MariaDB-debuginfo      ########################################### [ 57%]
   5:MariaDB-devel          ########################################### [ 71%]
   6:MariaDB-server         ########################################### [ 86%]

PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mariadb-admin -u root password 'new-password'
/usr/bin/mariadb-admin -u root -h hostname password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the MySQL manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MariaDB is available at http://www.askmonty.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Support MariaDB development by buying support/new features from
Monty Program Ab. You can contact us about this at sales@askmonty.org.
Alternatively consider joining our community based development effort:
http://askmonty.org/wiki/index.php/MariaDB#How_can_I_participate_in_the_development_of_MariaDB

Starting MySQL....[  OK  ]
Giving mysqld 2 seconds to start
   7:MariaDB-test           ########################################### [100%]

Be sure to follow the instructions given in the preceding output and create a password for the root user either by using mariadb-admin or by running the /usr/bin/mysql_secure_installation script.

Installing the MariaDB RPM files installs the MySQL tools in the /usr/bin directory. You can confirm that MariaDB has been installed by using the mariadb client program. Issuing the command mariadb should give you the MariaDB cursor.

See Also

  • Installing MariaDB with yum

  • Troubleshooting MariaDB Installs on RedHat/CentOS

  • Checking MariaDB RPM Package Signatures

This page is licensed: CC BY-SA / Gnu FDL

Installing MariaDB with zypper

On SLES, OpenSUSE, and other similar Linux distributions, it is highly recommended to install the relevant RPM packages from MariaDB's repository using zypper.

This page walks you through the simple installation steps using zypper.

Adding the MariaDB ZYpp repository

We currently have ZYpp repositories for the following Linux distributions:

  • SUSE Linux Enterprise Server (SLES) 12

  • SUSE Linux Enterprise Server (SLES) 15

  • OpenSUSE 15

  • OpenSUSE 42

Using the MariaDB Package Repository Setup Script

If you want to install MariaDB with zypper, then you can configure zypper to install from MariaDB Corporation's MariaDB Package Repository by using the MariaDB Package Repository setup script.

MariaDB Corporation provides a MariaDB Package Repository for several Linux distributions that use zypper to manage packages. This repository contains software packages related to MariaDB Server, including the server itself, clients and utilities, client libraries, plugins, and mariadb-backup. The MariaDB Package Repository setup script automatically configures your system to install packages from the MariaDB Package Repository.

To use the script, execute the following command:

curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash

Note that this script also configures a repository for MariaDB MaxScale and a repository for MariaDB Tools, which currently only contains Percona XtraBackup and its dependencies.

See MariaDB Package Repository Setup and Usage for more information.

Using the MariaDB Repository Configuration Tool

If you want to install MariaDB with zypper, then you can configure zypper to install from MariaDB Foundation's MariaDB Repository by using the MariaDB Repository Configuration Tool.

The MariaDB Foundation provides a MariaDB repository for several Linux distributions that use zypper to manage packages. This repository contains software packages related to MariaDB Server, including the server itself, clients and utilities, client libraries, plugins, and mariadb-backup. The MariaDB Repository Configuration Tool can easily generate the appropriate commands to add the repository for your distribution.

For example, if you wanted to use the repository to install MariaDB 10.6 on SLES 15, then you could use the following commands to add the MariaDB zypper repository:

sudo zypper addrepo --gpgcheck --refresh https://yum.mariadb.org/10.6/sles/15/x86_64 mariadb
sudo zypper --gpg-auto-import-keys refresh

Pinning the MariaDB Repository to a Specific Minor Release

If you wish to pin the zypper repository to a specific minor release, or if you would like to downgrade to a specific minor release, then you can create a zypper repository with the URL hard-coded to that specific minor release.

The MariaDB Foundation archives repositories of old minor releases at the following URL:

So if you can't find the repository of a specific minor release at yum.mariadb.org, then it would be a good idea to check the archive.

For example, if you wanted to pin your repository to MariaDB 10.6.21 on SLES 15, then you could use the following commands to add the MariaDB zypper repository:

sudo zypper removerepo mariadb
sudo zypper addrepo --gpgcheck --refresh https://yum.mariadb.org/10.6.21/sles/15/x86_64 mariadb

Updating the MariaDB ZYpp repository to a New Major Release

MariaDB's zypper repository can be updated to a new major release. How this is done depends on how you originally configured the repository.

Updating the Major Release with the MariaDB Package Repository Setup Script

If you configured zypper to install from MariaDB Corporation's MariaDB Package Repository by using the MariaDB Package Repository setup script, then you can update the major release that the repository uses by running the script again.

Updating the Major Release with the MariaDB Repository Configuration Tool

If you configured zypper to install from MariaDB Foundation's MariaDB Repository by using the MariaDB Repository Configuration Tool, then you can update the major release that the repository uses by removing the repository for the old version and adding the repository for the new version.

First, you can remove the repository for the old version by executing the following command:

sudo zypper removerepo mariadb

After that, you can add the repository for the new version. For example, if you wanted to use the repository to install MariaDB 10.6 on SLES 15, then you could use the following commands to add the MariaDB zypper repository:

sudo zypper addrepo --gpgcheck --refresh https://yum.mariadb.org/10.6/sles/15/x86_64 mariadb
sudo zypper --gpg-auto-import-keys refresh

After that, the repository should refer to MariaDB 10.6.

Importing the MariaDB GPG Public Key

Before MariaDB can be installed, you also have to import the GPG public key that is used to verify the digital signatures of the packages in our repositories. This allows the zypper and rpm utilities to verify the integrity of the packages that they install.

The id of our GPG public key is 0xcbcb082a1bb943db. The short form of the id is 0x1BB943DB. The full key fingerprint is:

1993 69E5 404B D5FC 7D2F E43B CBCB 082A 1BB9 43DB

The rpm utility can be used to import this key. For example:

sudo rpm --import https://yum.mariadb.org/RPM-GPG-KEY-MariaDB

Once the GPG public key is imported, you are ready to install packages from the repository.

Installing MariaDB Packages with ZYpp

After the zypper repository is configured, you can install MariaDB by executing the zypper command. The specific command that you would use would depend on which specific packages that you want to install.

Installing the Most Common Packages with ZYpp

To Install the most common packages, execute the following command:

sudo zypper install MariaDB-server galera-4 MariaDB-client MariaDB-shared MariaDB-backup MariaDB-common

Installing MariaDB Server with ZYpp

To Install MariaDB Server, execute the following command:

sudo zypper install MariaDB-server

Installing MariaDB Galera Cluster with ZYpp

The process to install MariaDB Galera Cluster with the MariaDB zypper repository is practically the same as installing standard MariaDB Server.

Galera Cluster support has been included in the standard MariaDB Server packages, so you will need to install the MariaDB-server package, as you normally would.

You also need to install the galera-4 package to obtain the Galera 4 wsrep provider library.

To install MariaDB Galera Cluster, you could execute the following command:

sudo zypper install MariaDB-server MariaDB-client galera-4

If you haven't yet imported the MariaDB GPG public key, then zypper will prompt you to import it after it downloads the packages, but before it prompts you to install them.

See MariaDB Galera Cluster for more information on MariaDB Galera Cluster.

Installing MariaDB Clients and Client Libraries with ZYpp

MariaDB Connector/C has been included as the client library. However, the package name for the client library has not been changed.

To Install the clients and client libraries, execute the following command:

sudo zypper install MariaDB-client MariaDB-shared

Installing mariadb-backup with ZYpp

To install mariadb-backup, execute the following command:

sudo zypper install MariaDB-backup

Installing Plugins with ZYpp

Some plugins may also need to be installed.

For example, to install the cracklib_password_check password validation plugin, execute the following command:

sudo zypper install MariaDB-cracklib-password-check

Installing Debug Info Packages with ZYpp

The MariaDB zypper repository also contains debuginfo packages. These package may be needed when debugging a problem.

Installing Debug Info for the Most Common Packages with ZYpp

To install debuginfo for the most common packages, execute the following command:

sudo zypper install MariaDB-server-debuginfo MariaDB-client-debuginfo MariaDB-shared-debuginfo MariaDB-backup-debuginfo MariaDB-common-debuginfo

Installing Debug Info for MariaDB Server with ZYpp

To install debuginfo for MariaDB Server, execute the following command:

sudo zypper install MariaDB-server-debuginfo

Installing Debug Info for MariaDB Clients and Client Libraries with ZYpp

MariaDB Connector/C has been included as the client library. However, the package name for the client library has not been changed.

To install debuginfo for the clients and client libraries, execute the following command:

sudo zypper install MariaDB-client-debuginfo MariaDB-shared-debuginfo

Installing Debug Info for mariadb-backup with ZYpp

To install debuginfo for mariadb-backup, execute the following command:

sudo zypper install MariaDB-backup-debuginfo

Installing Debug Info for Plugins with ZYpp

For some plugins, debuginfo may also need to be installed.

For example, to install debuginfo for the cracklib_password_check password validation plugin, execute the following command:

sudo zypper install MariaDB-cracklib-password-check-debuginfo

Installing Older Versions from the Repository

The MariaDB zypper repository contains the last few versions of MariaDB. To show what versions are available, use the following command:

zypper search --details MariaDB-server

In the output you will see the available versions.

To install an older version of a package instead of the latest version we just need to specify the package name, a dash, and then the version number. And we only need to specify enough of the version number for it to be unique from the other available versions.

However, when installing an older version of a package, if zypper has to install dependencies, then it will automatically choose to install the latest versions of those packages. To ensure that all MariaDB packages are on the same version in this scenario, it is necessary to specify them all.

The packages that the MariaDB-server package depend on are: MariaDB-client, MariaDB-shared, and MariaDB-common. Therefore, to install MariaDB 10.6.21 from this zypper repository, we would do the following:

sudo zypper install MariaDB-server-10.6.21 MariaDB-client-10.6.21 MariaDB-shared-10.6.21 MariaDB-backup-10.6.21 MariaDB-common-10.6.21

The rest of the install and setup process is as normal.

After Installation

After the installation is complete, you can start MariaDB.

If you are using MariaDB Galera Cluster, then keep in mind that the first node will have to be bootstrapped.

This page is licensed: CC BY-SA / Gnu FDL

MariaDB for DirectAdmin Using RPMs

If you are using DirectAdmin and you encounter any issues with Installing MariaDB with YUM, then the directions below may help. The process is very straightforward.

Note: Installing with YUM is preferable to installing the MariaDB RPM packages manually, so only do this if you are having issues such as:

Starting httpd:
  httpd:
    Syntax error on line 18 of /etc/httpd/conf/httpd.conf:
    Syntax error on line 1 of /etc/httpd/conf/extra/httpd-phpmodules.conf:
      Cannot load /usr/lib/apache/libphp5.so into server:
        libmysqlclient.so.18: cannot open shared object file: No such file or directory

Or:

Starting httpd:
  httpd:
    Syntax error on line 18 of /etc/httpd/conf/httpd.conf:
    Syntax error on line 1 of /etc/httpd/conf/extra/httpd-phpmodules.conf:
      Cannot load /usr/lib/apache/libphp5.so into server:
        /usr/lib/apache/libphp5.so: undefined symbol: client_errors

RPM Installation

To install the RPMs, there is a quick and easy guide to Installing MariaDB with the RPM Tool. Follow the instructions there.

Necessary Edits

We do not want DirectAdmin's custombuild to remove/overwrite our MariaDB installation whenever an update is performed. To rectify this, disable automatic MySQL installation.

Edit /usr/local/directadmin/custombuild/options.conf

Change:

mysql_inst=yes

To:

mysql_inst=no

Note: When MariaDB is installed manually (i.e. not using YUM), updates are not automatic. You will need to update the RPMs yourself.

This page is licensed: CC BY-SA / Gnu FDL

MariaDB Installation (Version 10.1.21) via RPMs on CentOS 7

Here are the detailed steps for installing MariaDB (version 10.1.21) via RPMs on CentOS 7.

The RPM's needed for the installation are all available on the MariaDB website and are given below:

  • jemalloc-3.6.0-1.el7.x86_64.rpm

  • MariaDB-10.1.21-centos7-x86_64-client.rpm

  • MariaDB-10.1.21-centos7-x86_64-compat.rpm

  • galera-25.3.19-1.rhel7.el7.centos.x86_64.rpm

  • jemalloc-devel-3.6.0-1.el7.x86_64.rpm

  • MariaDB-10.1.21-centos7-x86_64-common.rpm

  • MariaDB-10.1.21-centos7-x86_64-server.rpm

Step by step installation:

    1. First install all of the dependencies needed. Its easy to do this via YUM packages: yum install rsync nmap lsof perl-DBI nc

    1. rpm -ivh jemalloc-3.6.0-1.el7.x86_64.rpm

    1. rpm -ivh jemalloc-devel-3.6.0-1.el7.x86_64.rpm

    1. rpm -ivh MariaDB-10.1.21-centos7-x86_64-common.rpm MariaDB-10.1.21-centos7-x86_64-compat.rpm MariaDB-10.1.21-centos7-x86_64-client.rpm galera-25.3.19-1.rhel7.el7.centos.x86_64.rpm MariaDB-10.1.21-centos7-x86_64-server.rpm

While installing MariaDB-10.1.21-centos7-x86_64-common.rpm there might be a conflict with older MariaDB packages. we need to remove them and install the original rpm again.

Here is the error message for dependencies:

# rpm -ivh MariaDB-10.1.21-centos7-x86_64-common.rpm 
warning: MariaDB-10.1.21-centos7-x86_64-common.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY
error: Failed dependencies:
	mariadb-libs < 1:10.1.21-1.el7.centos conflicts with MariaDB-common-10.1.21-1.el7.centos.x86_64

Solution: search for this package:

# rpm -qa | grep mariadb-libs
mariadb-libs-5.5.52-1.el7.x86_64

Remove this package:

# rpm -ev --nodeps mariadb-libs-5.5.52-1.el7.x86_64
Preparing packages...
mariadb-libs-1:5.5.52-1.el7.x86_64

While installing the Galera package there might be a conflict in installation for a dependency package. Here is the error message:

[root@centos-2 /]# rpm -ivh galera-25.3.19-1.rhel7.el7.centos.x86_64.rpm 
error: Failed dependencies:
	libboost_program_options.so.1.53.0()(64bit) is needed by galera-25.3.19-1.rhel7.el7.centos.x86_64

The dependencies for Galera package is: libboost_program_options.so.1.53.0

Solution:

yum install boost-devel.x86_64

Another warning message while installing Galera package is as shown below:

warning: galera-25.3.19-1.rhel7.el7.centos.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY

The solution for this is to import the key:

#rpm --import http://yum.mariadb.org/RPM-GPG-KEY-MariaDB

After step 4, the installation will be completed. The last step will be to run mysql_secure_installation to secure the production server by dis allowing remote login for root, creating root password and removing the test database.

    1. mysql_secure_installation

This page is licensed: CC BY-SA / Gnu FDL

Troubleshooting MariaDB Installs on RHEL / CentOS

The following article is about different issues people have encountered when installing MariaDB on RHEL / CentOS.

It is highly recommended to install with yum where possible.

In RHEL/ CentOS it is also possible to install a RPM or a tar ball. The RPM is the preferred version, except if you want to install many versions of MariaDB or install MariaDB in a non standard location.

Replacing MySQL

If you removed an MySQL RPM to install MariaDB, note that the MySQL RPM on uninstall renames /etc/my.cnf to /etc/my.cnf.rpmsave.

After installing MariaDB you should do the following to restore your configuration options:

mv /etc/my.cnf.rpmsave /etc/my.cnf

Unsupported configuration options

If you are using any of the following options in your /etc/my.cnf or other my.cnf file you should remove them. This is also true for MySQL 5.1 or newer:

skip-bdb

See also

  • Installing with yum (recommended)

  • Installing MariaDB RPM Files

  • Checking MariaDB RPM Package Signatures

This page is licensed: CC BY-SA / Gnu FDL

Why Source RPMs (SRPMs) Aren't Packaged For Some Platforms

MariaDB source RPMs (SRPMs) are not packaged on all platforms for which MariaDB RPMs are packaged.

The reason is that MariaDB's build process relies heavily on cmake for a lot of things. In this specific case, MariaDB's build process relies on CMake CPack Package Generators to build RPMs. The specific package generator that it uses to build RPMs is called CPackRPM.

Support for source RPMs in CPackRPM became usable with MariaDB's build system starting from around cmake 3.10. This means that we do not produce source RPMs on platforms where the installed cmake version is older than that.

See also Building MariaDB from a Source RPM.

This page is licensed: CC BY-SA / Gnu FDL

Installing MariaDB with yum/dnf

On RHEL, CentOS, Fedora, and other similar Linux RPM based distributions, these provide MariaDB packages. These are supported by those distributions. If you have a particular need for a later version than what is in the distribution, then MariaDB provides repositories for them.

Using repositories rather than installing RPM allows for an ease of update when a new release is made. It is highly recommended to install the relevant RPM packages from MariaDB's repository using yum or dnf. Centos 7 still uses yum, most others use dnf, and SUSE/openSUSE use zypper.

This page walks you through the simple installation steps using dnf and yum.

Adding the MariaDB YUM repository

We currently have YUM/DNF repositories for the following Linux distributions, and for the versions that are in standard (not extended) support:

  • Red Hat Enterprise Linux (RHEL)

  • CentOS

  • Fedora

  • openSUSE

  • SUSE

Using the MariaDB Package Repository Setup Script

If you want to install MariaDB with yum, then you can configure yum to install from MariaDB Corporation's MariaDB Package Repository by using the MariaDB Package Repository setup script.

MariaDB Corporation provides a MariaDB Package Repository for several Linux distributions that use yum to manage packages. This repository contains software packages related to MariaDB Server, including the server itself, clients and utilities, client libraries, plugins, and mariadb-backup. The MariaDB Package Repository setup script automatically configures your system to install packages from the MariaDB Package Repository.

To use the script, execute the following command:

curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash

Note that this script also configures a repository for MariaDB MaxScale and a repository for MariaDB Tools, which currently only contains Percona XtraBackup and its dependencies.

See MariaDB Package Repository Setup and Usage for more information.

Using the MariaDB Repository Configuration Tool

If you want to install MariaDB with yum, then you can configure yum to install from MariaDB Foundation's MariaDB Repository by using the MariaDB Repository Configuration Tool.

The MariaDB Foundation provides a MariaDB repository for several Linux distributions that use yum to manage packages. This repository contains software packages related to MariaDB Server, including the server itself, clients and utilities, client libraries, plugins, and mariadb-backup. The MariaDB Repository Configuration Tool can easily generate the appropriate configuration file to add the repository for your distribution.

Once you have the appropriate repository configuration section for your distribution, add it to a file named MariaDB.repo under /etc/yum.repos.d/.

For example, if you wanted to use the repository to install MariaDB 10.6 on RHEL (any version), then you could use the following yum repository configuration in /etc/yum.repos.d/MariaDB.repo:

[mariadb]
name = MariaDB
baseurl = https://rpm.mariadb.org/10.6/rhel/$releasever/$basearch
gpgkey= https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

The example file above includes a gpgkey line to automatically fetch the GPG public key that is used to verify the digital signatures of the packages in our repositories. This allows the yum, dnf, and rpm utilities to verify the integrity of the packages that they install.

Pinning the MariaDB Repository to a Specific Minor Release

If you wish to pin the yum repository to a specific minor release, or if you would like to do a yum downgrade to a specific minor release, then you can create a yum repository configuration with a baseurl option set to that specific minor release.

The MariaDB Foundation archives repositories all releases is at the following URL:

Note this isn't configured as a highly available server. For that purpose please use the main mirrors.

For example, if you wanted to pin your repository to MariaDB 10.8.8 on CentOS 7, then you could use the following yum repository configuration in /etc/yum.repos.d/MariaDB.repo:

[mariadb]
name = MariaDB-10.8.8
baseurl= http://archive.mariadb.org/mariadb-10.8.8/yum/centos/$releasever/$basearch
gpgkey= https://archive.mariadb.org/PublicKey
gpgcheck=1

Note that if you change an existing repository configuration, then you may need to execute the following:

sudo yum clean all

Updating the MariaDB YUM repository to a New Major Release

MariaDB's yum repository can be updated to a new major release. How this is done depends on how you originally configured the repository.

Updating the Major Release with the MariaDB Package Repository Setup Script

If you configured yum to install from MariaDB Corporation's MariaDB Package Repository by using the MariaDB Package Repository setup script, then you can update the major release that the repository uses by running the script again.

Updating the Major Release with the MariaDB Repository Configuration Tool

If you configured yum to install from MariaDB Foundation's MariaDB Repository by using the MariaDB Repository Configuration Tool, then you can update the major release that the repository uses by updating the yum repository configuration file in-place. For example, if you wanted to change the repository from MariaDB 10.6 to MariaDB 10.11, and if the repository configuration file was at /etc/yum.repos.d/MariaDB.repo, then you could execute the following:

sudo sed -i 's/10.6/10.11/' /etc/yum.repos.d/MariaDB.repo

After that, the repository should refer to MariaDB 10.11.

If the yum repository is pinned to a specific minor release, then the above sed command can result in an invalid repository configuration. In that case, the recommended options are:

  • Edit the MariaDB.repo repository file manually.

  • Or delete the MariaDB.repo repository file, and then install the repository of the new version with the more robust MariaDB Package Repository setup script.

Importing the MariaDB GPG Public Key

Before MariaDB can be installed, you also have to import the GPG public key that is used to verify the digital signatures of the packages in our repositories. This allows the yum, dnf and rpm utilities to verify the integrity of the packages that they install.

The id of our GPG public key is:

  • short form: 0xC74CD1D8

  • long form: 0xF1656F24C74CD1D8

  • full fingerprint: 177F 4010 FE56 CA33 3630 0305 F165 6F24 C74C D1D8

yum should prompt you to import the GPG public key the first time that you install a package from MariaDB's repository. However, if you like, the rpm utility can be used to manually import this key instead. For example:

sudo rpm --import https://supplychain.mariadb.com/MariaDB-Server-GPG-KEY

Once the GPG public key is imported, you are ready to install packages from the repository.

Old Key

For releases before 2023 an older SHA1 based GPG key was used.

The id of this older GPG public key was 0xcbcb082a1bb943db. The short form was 0x1BB943DB. The full key fingerprint was:

1993 69E5 404B D5FC 7D2F E43B CBCB 082A 1BB9 43DB

Installing MariaDB Packages with YUM/DNF

After the dnf/yum repository is configured, you can install MariaDB by executing the dnf or yum command. The specific command that you would use would depend on which specific packages that you want to install.

Installing the Most Common Packages

To Install the most common packages, execute the following command:

sudo dnf install MariaDB-server galera-4 MariaDB-client MariaDB-shared MariaDB-backup MariaDB-common

Installing MariaDB Server

To Install MariaDB Server, execute the following command:

sudo dnf install MariaDB-server

Installing MariaDB Galera Cluster with YUM

The process to install MariaDB Galera Cluster with the MariaDB yum repository is practically the same as installing standard MariaDB Server.

You need to install the galera-4 package to obtain the Galera 4 wsrep provider library.

To install MariaDB Galera Cluster, you could execute the following command:

sudo yum install MariaDB-server MariaDB-client galera-4

If you haven't yet imported the MariaDB GPG public key, then yum will prompt you to import it after it downloads the packages, but before it prompts you to install them.

See MariaDB Galera Cluster for more information on MariaDB Galera Cluster.

Installing MariaDB Clients and Client Libraries with YUM

MariaDB Connector/C has been included as the client library (staticly linked). However, the package name for the client library has not been changed.

To Install the clients and client libraries, execute the following command:

sudo yum install MariaDB-client MariaDB-shared

If you want compile your own programs against MariaDB Connector/C, execute the following command:

sudo yum install MariaDB-devel

Installing mariadb-backup with YUM

To install mariadb-backup, execute the following command:

sudo yum install MariaDB-backup

Installing Plugins with YUM

Some plugins may also need to be installed.

For example, to install the cracklib_password_check password validation plugin, execute the following command:

sudo yum install MariaDB-cracklib-password-check

Installing Debug Info Packages with YUM

The MariaDB yum repository also contains debuginfo packages. These package may be needed when debugging a problem.

Installing Debug Info for the Most Common Packages with YUM

To install debuginfo for the most common packages, execute the following command:

sudo yum install MariaDB-server-debuginfo MariaDB-client-debuginfo MariaDB-shared-debuginfo MariaDB-backup-debuginfo MariaDB-common-debuginfo

All packages have their debuginfo by appending -debuginfo to the package name.

Installing Debug Info for MariaDB Server with YUM

To install debuginfo for MariaDB Server, execute the following command:

sudo yum install MariaDB-server-debuginfo

Installing Older Versions from the Repository

The MariaDB yum repository contains the last few versions of MariaDB. To show what versions are available, use the following command:

yum list --showduplicates MariaDB-server

The output shows the available versions. For example:

$ yum list --showduplicates MariaDB-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.mirrors.ovh.net
 * extras: centos.mirrors.ovh.net
 * updates: centos.mirrors.ovh.net
Available Packages
MariaDB-server.x86_64   10.3.10-1.el7.centos    mariadb
MariaDB-server.x86_64   10.3.11-1.el7.centos    mariadb
MariaDB-server.x86_64   10.3.12-1.el7.centos    mariadb
mariadb-server.x86_64   1:5.5.60-1.el7_5         base

The MariaDB yum repository in this example contains MariaDB 10.3.10, MariaDB 10.3.11, and MariaDB 10.3.12. The CentOS base yum repository also contains MariaDB 5.5.60.

To install an older version of a package instead of the latest version we just need to specify the package name, a dash, and then the version number. And we only need to specify enough of the version number for it to be unique from the other available versions.

However, when installing an older version of a package, if yum has to install dependencies, then it will automatically choose to install the latest versions of those packages. To ensure that all MariaDB packages are on the same version in this scenario, it is necessary to specify them all.

The packages that the MariaDB-server package depend on are: MariaDB-client, MariaDB-shared, and MariaDB-common. Therefore, to install MariaDB 10.3.11 from this yum repository, we would do the following:

sudo yum install MariaDB-server-10.3.11 MariaDB-client-10.3.11 MariaDB-shared-10.3.11 MariaDB-backup-10.3.11 MariaDB-common-10.3.11

The rest of the install and setup process is as normal.

After Installation

After the installation is complete, you can start MariaDB.

If you are using MariaDB Galera Cluster, then keep in mind that the first node will have to be bootstrapped.

This page is licensed: CC BY-SA / Gnu FDL