Install MariaDB on CentOS 7 or RHEL 7

Install MariaDB on CentOS 7 or RHEL 7

By default Centos 7 repository is MySQL 5.5. If you want to use latest stable MariaDB, you need to use Official MariaDB repository.

You need to create MariaDB repository on /etc/yum.repos.d/MariaDB.repo and paste code below.

name = MariaDB
baseurl =

If you want to use MariaDB specific release for example MariaDB 10.3.14, you can put minor release version on MariaDB.repo.

name = MariaDB-10.3.14
# alternative: baseurl=
MariaDB repository

Then clean all yum cache with

# sudo yum clean all

Import the GPG public key from MariaDB for the first time that you install a package from MariaDB’s repository.

# sudo rpm --import

Then this command will install MariaDB on your Centos 7

# sudo yum install MariaDB-server galera MariaDB-client MariaDB-shared MariaDB-backup MariaDB-common

MariaDB configuration is on /etc/my.cnf and /etc/conf.d/*.conf. Please configure it, for example InnoDB memory, MyISAM etc.

Enable MariaDB on start up and start MariaDB daemon.

# systemctl enable mariadb
# systemctl start mariadb

Leave a Reply

Your email address will not be published. Required fields are marked *