Search

How To Install Specific MariaDB or MySQL on CentOS RHEL Debian Ubuntu SLES

How To Install Specific MariaDB or MySQL on CentOS RHEL Debian Ubuntu SLES

1. MariaDB Package Repository Setup on CentOS RHEL Debian Ubuntu SLES

If you are looking to set up MariaDB Server, the easiest option is to the use repo config tool at https://downloads.mariadb.org/. or https://mariadb.com/kb/en/mariadb-package-repository-setup-and-usage/

Alternatively, MariaDB Corporation provides a convenient shell script to configure access to their MariaDB Package Repositories. It is available at: https://downloads.mariadb.com/MariaDB/mariadb_repo_setup

The script can be executed in the following way:

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

For the script to work, the curl and ca-certificates packages need to be installed on your system. Additionally on Debian and Ubuntu the apt-transport-https package needs to be installed. The script will check if these are installed and let you know before it attempts to create the repository configuration on your system

Supported Distributions

The script supports Linux distributions that are officially supported by MariaDB Corporation's MariaDB TX subscription. However, a MariaDB TX subscription with MariaDB Corporation is not required to use the MariaDB Package Repository.

The distributions currently supported by the script include:

  • Red Hat Enterprise Linux (RHEL) 7 and 8
  • CentOS 7 and 8
  • Debian 9 (Stretch), and 10 (Buster)
  • Ubuntu 16.04 LTS (Xenial), 18.04 LTS (Bionic), and 20.04 (Focal)
  • SUSE Linux Enterprise Server (SLES) 12 and 15

 

To install MariaDB on distributions not supported by the MariaDB Package Repository setup script, please consider using MariaDB Foundation's MariaDB Repository Configuration Tool. Some Linux distributions also include MariaDB in their own repositories.

The script can also configure your system to install from the repository of a different version of MariaDB if you use the --mariadb-server-version option

  curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version="mariadb-10.3"  

The following MariaDB versions are currently supported:

mariadb-10.2
mariadb-10.3
mariadb-10.4
mariadb-10.5 

For example, to configure your system to install from the repository of MariaDB MaxScale 2.3, that would be:

 curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --mariadb-maxscale-version="2.3"    

The following MariaDB MaxScale versions are currently supported:

MaxScale 1.4
MaxScale 2.0
MaxScale 2.1
MaxScale 2.2
MaxScale 2.3
MaxScale 2.4
MaxScale 2.5 

2. Installing Packages with the MariaDB Package Repository

Installing Packages on RHEL and CentOS

To install MariaDB on Red Hat Enterprise Linux (RHEL) and CentOS, see the instructions at Installing MariaDB Packages with YUM. For example:

sudo yum install MariaDB-server MariaDB-client MariaDB-backup 

To install MariaDB MaxScale on Red Hat Enterprise Linux (RHEL) and CentOS, see the instructions at MariaDB MaxScale Installation Guide. For example:

sudo yum install maxscale 

Installing Packages on Debian and Ubuntu

To install MariaDB on Debian and Ubuntu, see the instructions at Installing MariaDB Packages with APT. For example:

sudo apt-get install mariadb-server mariadb-client mariadb-backup 

To install MariaDB MaxScale on Debian and Ubuntu, see the instructions at MariaDB MaxScale Installation Guide. For example:

sudo apt-get install maxscale 

Installing Packages on SLES

To install MariaDB on SUSE Linux Enterprise Server (SLES), see the instructions at Installing MariaDB Packages with ZYpp. For example:

 sudo zypper install MariaDB-server MariaDB-client MariaDB-backup

To install MariaDB MaxScale on SUSE Linux Enterprise Server (SLES), see the instructions at MariaDB MaxScale Installation Guide. For example:

sudo zypper install maxscale

Conclusion

In this tutorial, we’ve installed and secured MariaDB on your server.

Sys Admin

Sys Admin

I am a Red Hat Certified Engineer (RHCE) and working as an IT Professional since 2012...