For CentOS, RedHat, and Fedora, it is highly recommended to install from a
yum. This page walks you through the simple steps.
Adding the MariaDB YUM Repository
We have YUM repositories for several YUM-based Linux distributions. To easily generate the appropriate MariaDB.repo entry for your distribution, use our online repository generator.
We currently have YUM repositories for CentOS 5, CentOS 6, RHEL 5, RHEL 6, Fedora 16, and Fedora 17.
Once you have your MariaDB.repo entry, add it to a file under
/etc/yum.repos.d/. (We suggest something like
MariaDB.repo file for CentOS 6 64 bits is:
[mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.0/centos6-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
The example file above includes a
gpgkey line to automatically fetch the
GPG key we use to sign the repositories. This key enables
to verify the integrity of the packages it downloads.
The id of our signing key is
0xcbcb082a1bb943db. The short form of the id
0x1BB943DB and the full key fingerprint is:
1993 69E5 404B D5FC 7D2F E43B CBCB 082A 1BB9 43DB
If you wish to fix the version to an older version, or do a
yum downgrade, you can create a yum repo defination with a baseurl set to a specific version:
[mariadb] name = MariaDB-5.5.39 baseurl=http://archive.mariadb.org/mariadb-5.5.39/yum/rhel6-amd64/ gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
Installing MariaDB with YUM
With the repo file in place you can now install MariaDB like so:
sudo yum install MariaDB-server MariaDB-client
If you don't have the MariaDB GPG Signing key installed, YUM will prompt you to install it after downloading the packages (but before installing them).
If the server already has the MariaDB-Galera-server package installed, you
might need to remove it prior to installing MariaDB-server
sudo yum remove MariaDB-Galera-server'). No databases are removed
when the MariaDB-Galera-server rpm package is removed, but as with any upgrade,
it is best to have backups.
Installing TokuDB with YUM
Instructions for installing TokuDB are on the How to Enable TokuDB in MariaDB page.
Installing MariaDB Galera Cluster with YUM
The instructions for installing MariaDB Galera Cluster are virtually the same as for installing MariaDB. The setup of the repo file is the same. The only difference is in the install step. Instead of installing the MariaDB-server package, you install the MariaDB-Galera-server and galera packages, like so:
sudo yum install MariaDB-Galera-server MariaDB-client galera
As with MariaDB-server, if you don't have the MariaDB GPG Signing key installed, YUM will prompt you to install it after downloading the packages (but before installing them).
If the server already has the MariaDB-server package installed, you might need
to remove it prior to installing MariaDB-Galera-server
sudo yum remove MariaDB-server'). No databases are removed when the
MariaDB-server rpm package is removed, but as with any upgrade, it is best to
See the Galera section of the Knowledgebase for more information on MariaDB Galera Cluster.
Installing MariaDB Galera Cluster on Fedora 17 and 18
galera package is incompatible with
yum on Fedora 17 & 18, so to install MariaDB
Galera Cluster you need to first install the
galera package manually using
On 64-bit systems, do:
curl -O http://yum.mariadb.org/5.5.33a/fedora18-amd64/rpms/galera-23.2.7-1.fc18.x86_64.rpm sudo rpm -ivh galera-23.2.7-1.fc18.x86_64.rpm
On 32-bit systems, do:
curl -O http://yum.mariadb.org/5.5.33a/fedora18-x86/rpms/galera-23.2.7-1.fc18.i686.rpm sudo rpm -ivh galera-23.2.7-1.fc18.i686.rpm
Then install MariaDB Galera Server with:
sudo yum clean all # do this to prevent a warning sudo yum install MariaDB-Galera-server MariaDB-client
To install MariaDB Galera Cluster on Fedora 19, follow the regular instructions, above.
After the installation completes, start MariaDB with:
sudo /etc/init.d/mysql start
Manually Importing the MariaDB Signing Key
If you like, you can manually install the GPG key using the
sudo rpm --import https://yum.mariadb.org/RPM-GPG-KEY-MariaDB