Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Install MariaDB on CentOS 8 - DesignLinux

Dec 15 2020
designlinux 0 Comments

MariaDB is an open-source, community-developed relational database management system. It is forked from MySQL and created and maintained by the developers who created MySQL. MariaDB is intended to be highly compatible with MySQL but new features have been added to MariaDB like new storage engines (Aria, ColumnStore, MyRocks).

In this article, we will take a look at the installation and configuration of MariaDB on CentOS 8 Linux.

Step 1: Enable the MariaDB Repository on CentOS 8

Go to the official MariaDB downloads page and select CentOS as the distribution and CentOS 8 as the version and MariaDB 10.5 (stable version) to get the repository.

Once you select the details, you will get MariaDB YUM repository entires. Copy and paste these entries into a file called /etc/yum.repos.d/MariaDB.repo.

$ sudo vim /etc/yum.repos.d/mariadb.repo
# MariaDB 10.5 CentOS repository list - created 2020-12-15 07:13 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.5/centos8-amd64
module_hotfixes=1
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Once the repository file in place, you can verify the repository by running the following command.

$ dnf repolist
Check MariaDB Repository
Check MariaDB Repository

Step 2: Installing MariaDB on CentOS 8

Now use the dnf command to install the MariaDB package.

$ sudo dnf install MariaDB-server -y

Next, start the MariaDB service and enable it to autostart during system startup.

$ systemctl start mariadb
$ systemctl enable mariadb

Check the status of the MariaDB service by running the following command.

$ systemctl status mariadb 
Check MariaDB Status
Check MariaDB Status

If you have a firewall enabled, you need to add MariaDB to the firewall rule by running the below command. Once the rule is added, the firewall needs to be reloaded.

$ sudo firewall-cmd --permanent --add-service=mysql
$ sudo firewall-cmd --reload

Step 3: Securing the MariaDB Server on CentOS 8

As the last step, we need to run a secure MariaDB installation script. This script takes care of setting up the root password, reloading privileges, removing test databases, disallowing root login.

$ sudo mysql_secure_installation
Secure MariaDB in CentOS 8
Secure MariaDB in CentOS 8

Now connect to MariaDB as the root user and check the version by running the following commands.

$ mysql -uroot -p
Connect to MariaDB Shell
Connect to MariaDB Shell

That’s it for this article. We have seen how to install and configure MariaDB on CentOS 8 Linux.

Related

Tags: CentOS Tips, MariaDB Tips

How to Rename Files and Directories in Linux

Prev Post

How to Set Up High Availability for Namenode – Part 5

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 2
  • 621
  • 1,055,393

DesignLinux.com © All rights reserved

Go to mobile version