How To Install MariaDB on RHEL 8
MariaDB is one of the most popular open source database management system used by small to large enterprises. It is a fork of famous database server MySQL, developed by MariaDB Corporation Ab, led by original developers of MySQL.
Install MariaDB on RHEL 8
Install MariaDB from Red Hat
Installing MariaDB from Red Hat AppStream repository (rhel-8-for-x86_64-appstream-rpms) is a straightforward way, but the repository may have a bit old version of MariaDB package.
yum -y install @mariadb
Install MariaDB from Official MariaDB Mirror
MariaDB foundation offers MariaDB packages for RHEL 8. Packages provided by MariaDB is always fresh and supported by the MariaDB community. Add one of the repository mirrors to the system that MariaDB offers for RHEL 8.
cat <<EOF >> /etc/yum.repos.d/mariadb.repo [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.3/rhel8-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 EOF
Install MariaDB server using the following command.
yum --disablerepo=rhel-8-for-x86_64-appstream-rpms install -y MariaDB-server MariaDB-client
Manage MariaDB Service
In case you want to start/stop the MariaDB service, you can use the following commands.
systemctl start mariadb systemctl stop mariadb
Verify whether MariaDB is running or not.
systemctl status mariadb
Secure MariaDB Installation
Use mysql_secure_installation command to do the initial setup of the MariaDB server. This command is recommended to run in production servers. It removes anonymous user, test database, and disallows remote root login.
Login into MariaDB server with the below command.
mysql -u root -p