Linux

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.

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

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

[mariadb]
name = MariaDB-10.3.14
baseurl=http://yum.mariadb.org/10.3.14/centos7-amd64
# alternative: baseurl=http://archive.mariadb.org/mariadb-10.3.14/yum/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Then clean all yum cache with

Related Post
# 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 https://yum.mariadb.org/RPM-GPG-KEY-MariaDB

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

Recent Posts

How to fix yum update error thread.error: can’t start new thread

If you found error thread.error: can't start new thread on yum update command on CentOS…

5 months ago

How to securing Cockpit login with Google Two Factor Authenticator 2FA

Cockpit is a web-based graphical interface for servers, intended for everyone, especially those who are:…

8 months ago

How to install Cockpit on CentOS 7 / CentOS 9 Stream and configure Nginx reserve proxy

From cockpit-project.org, Cockpit is a web-based graphical interface for servers, intended for everyone, especially those…

11 months ago

How to install and configure Nginx with HTTP3 on CentOS 9 Stream / RHEL 9

We have been using Nginx with HTTP3 for more than 1 year on our production…

11 months ago

How to sync date time using Crony on CentOS 9 Stream / RHEL 9

On CentOS 7, to sync date time we often use NTPD. But on CentOS 9,…

11 months ago

How to install and enable REMI repository on CentOS 9 Stream

Remi repository is one of third-party repository that have latest update of PHP on Enterprise…

11 months ago