For CentOS, RedHat, and Fedora, it is highly recommended to install from a
repository using
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, CentOS 7, RHEL 5, RHEL 6, RHEL 7, and Fedora 21.
Once you have your MariaDB.repo entry, add it to a file under
/etc/yum.repos.d/
. (We suggest something like
/etc/yum.repos.d/MariaDB.repo
.)An example
MariaDB.repo
file for CentOS 7 is:[mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.1/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1The example file above includes a
gpgkey
line to automatically fetch the
GPG key we use to sign the repositories. This key enables yum
and rpm
to verify the integrity of the packages it downloads. The id of our signing key is
0xcbcb082a1bb943db
. The short form of the id
is 0x1BB943DB
and the full key fingerprint is:1993 69E5 404B D5FC 7D2F E43B CBCB 082A 1BB9 43DBIf you wish to fix the version to an older version, or do a
yum downgrade
, you can create a yum repo definition with a baseurl set to a specific version. yum clean metadata
is needed if you change an existing repo definition:[mariadb] name = MariaDB-5.5.39 baseurl=https://downloads.mariadb.com/files/MariaDB/mariadb-5.5.39/yum/rhel6-amd64/ # alternative: 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-clientIf 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 (with '
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
MariaDB until 10.0
Galera Cluster is included in the default MariaDB packages from 10.1, so the instructions in this section are only required for MariaDB 10.0 and MariaDB 5.5.sudo yum install MariaDB-Galera-server MariaDB-client galeraAs 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 (with '
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
have backups.See the Galera section of the Knowledgebase for more information on MariaDB Galera Cluster.
After Installation
After the installation completes, start MariaDB with:sudo systemctl start mariadbor if your system is not using
systemctl
:sudo /etc/init.d/mysql start
Manually Importing the MariaDB Signing Key
If you like, you can manually install the GPG key using therpm
application
like so:sudo rpm --import https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
Comments
9 months, 1 week ago
biggthed
I receive an error when instaling on RHEL6
yum install MariaDB-Galera-server MariaDB-client galera
Error: Package: galera-25.3.9-1.rhel6.el6.x86_64 (mariadb) Requires: nc
I have /usr/bin/nc installed. Is there a reason this is happening?
yum install MariaDB-Galera-server MariaDB-client galera
Error: Package: galera-25.3.9-1.rhel6.el6.x86_64 (mariadb) Requires: nc
I have /usr/bin/nc installed. Is there a reason this is happening?
10 months ago
martybens
running
No package MariaDB-Galera-server available.
yum install MariaDB-Galera-server MariaDB-client galera
[mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.0/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1It's not finding the server package:
No package MariaDB-Galera-server available.
10 months ago
daniel_bartholomew_g1
I just tried running the yum command and using the
MariaDB.repo file you have on a new CentOS 7 VM and it worked. You might
try issuing a
yum clean all
to force yum to redownload the repository metadata.
1 year, 4 months ago
robertocazzato
With yum priority plug-in activated (is also a good practice), we get:
--> MariaDB-Galera-server-5.5.39-1.el6.x86_64 from mariadb excluded (priority) --> MariaDB-client-5.5.39-1.el6.x86_64 from mariadb excluded (priority) --> MariaDB-compat-5.5.39-1.el6.x86_64 from mariadb excluded (priority) --> MariaDB-devel-5.5.39-1.el6.x86_64 from mariadb excluded (priority) --> MariaDB-server-5.5.39-1.el6.x86_64 from mariadb excluded (priority) --> MariaDB-shared-5.5.39-1.el6.x86_64 from mariadb excluded (priority) --> MariaDB-test-5.5.39-1.el6.x86_64 from mariadb excluded (priority) --> MariaDB-Galera-test-5.5.39-1.el6.x86_64 from mariadb excluded (priority) 8 packages excluded due to repository priority protections
A conflict was found for mysql-libs.x86_64 (5.1.73-3.el6_5), probably resolved forcing removal of this libs, replaced with mariadb version, but can you tell us how correct priority and mysql-libs issue ?
Thank you
--> MariaDB-Galera-server-5.5.39-1.el6.x86_64 from mariadb excluded (priority) --> MariaDB-client-5.5.39-1.el6.x86_64 from mariadb excluded (priority) --> MariaDB-compat-5.5.39-1.el6.x86_64 from mariadb excluded (priority) --> MariaDB-devel-5.5.39-1.el6.x86_64 from mariadb excluded (priority) --> MariaDB-server-5.5.39-1.el6.x86_64 from mariadb excluded (priority) --> MariaDB-shared-5.5.39-1.el6.x86_64 from mariadb excluded (priority) --> MariaDB-test-5.5.39-1.el6.x86_64 from mariadb excluded (priority) --> MariaDB-Galera-test-5.5.39-1.el6.x86_64 from mariadb excluded (priority) 8 packages excluded due to repository priority protections
A conflict was found for mysql-libs.x86_64 (5.1.73-3.el6_5), probably resolved forcing removal of this libs, replaced with mariadb version, but can you tell us how correct priority and mysql-libs issue ?
Thank you
1 year, 11 months ago
pingpong
I installed MariaDB 10 on CentOS 6.5 64 bit.
What should I do that after installation? How to check that on CentOS?
Thanks in advance.
[mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.0/centos6-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1It successfully installed. But the installation process didn't let me configure user name, password, database instance name, and port.
What should I do that after installation? How to check that on CentOS?
Thanks in advance.
10 months ago
daniel_bartholomew_g1
On yum-based distributions, the only MariaDB user set
up is root, and there is no password. You can use the
mysql_secure_installation script to set the root password.
For compatibility, the service name and port are by default the same as MySQL: mysql and 3306. Binaries are also named the same: mysqld for the server and mysql for the client.
After installation you can start MariaDB with
For compatibility, the service name and port are by default the same as MySQL: mysql and 3306. Binaries are also named the same: mysqld for the server and mysql for the client.
After installation you can start MariaDB with
sudo /etc/init.d/mysql start
or sudo service mysql start