How To Install MariaDB 10.8 on Centos 7

In this tutorial, we intend to teach you How To Install MariaDB 10.8 on Centos 7.

MariaDB is an open-source relational database management system (DBMS) that is a compatible drop-in replacement for the widely used MySQL database technology.

MariaDB is based on SQL and supports ACID-style data processing with guaranteed atomicity, consistency, isolation, and durability for transactions. Among other features, the database also supports JSON APIs, parallel data replication, and multiple storage engines, including InnoDB, MyRocks, Spider, Aria, TokuDB, Cassandra, and MariaDB ColumnStore.

How To Install MariaDB 10.8 on Centos 7

To install MariaDB 10.8, you must log in to your server as a non-root user with sudo privileges. To do this, you can check our guide the Initial Server Setup with Centos 7.

Now follow the steps below to complete this guide.

Set up MariaDB 10.8 on Centos 7

To install MariaDB 10.8, you need to add the new MariaDB repository to your server.

First, create a repository file with your favorite text editor, here we use vi:

sudo vi /etc/yum.repos.d/MariaDB.repo

Add the following content to your file:

[mariadb]
name = MariaDB
baseurl = https://mariadb.mirror.wearetriple.com/yum/10.8/centos7-amd64
gpgkey=https://mariadb.mirror.wearetriple.com/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1

When you are done, save and close the file.

Then, you can use the following command to install MariaDB 10.8 on your server:

sudo yum install MariaDB-server MariaDB-client -y

Once your installation is completed, start and enable your MariaDB service to start on boot, with the following commands:

# sudo systemctl start mariadb
# sudo systemctl enable mariadb

At this point, verify that your MariaDB service is active and running on your Centos 7:

sudo systemctl status mariadb
Output
● mariadb.service - MariaDB 10.8.3 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: active (running) since Wed 2022-06-22 07:30:34 EDT; 47s ago
Docs: man:mariadbd(8)
https://mariadb.com/kb/en/library/systemd/
Main PID: 22371 (mariadbd)
Status: "Taking your SQL requests now..."
CGroup: /system.slice/mariadb.service
└─22371 /usr/sbin/mariadbd

Howe To Run MariaDB Secure Script

At this point, that you have MariaDB installed on your server, you need to secure your MariaDB by setting a root password, disabling remote root login, removing the test database as well as anonymous users, and finally reload privileges.

To do this, run the following script:

mariadb-secure-installation
Enter current password for root (enter for none):
Switch to unix_socket authentication [Y/n] n
You already have your root account protected, so you can safely answer 'n'.
Change the root password? [Y/n] n
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

Also, you can verify your MariaDB 10.8 installation by checking its version:

mysql -V
Output
mysql Ver 15.1 Distrib 10.8.3-MariaDB, for Linux (x86_64) using readline 5.1

Finally, you can access your MariaDB shell with the following command:

sudo mysql -u root -p
Output
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.8.3-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

For more information, you can visit the MariaDB Documentation page.

Conclusion

At this point, you learn to Install MariaDB 10.8 on Centos 7.

Hope you enjoy using it.

Also, if you have an older version of MariaDB and want to upgrade it to a new version, you can check our guide How To Upgrade MariaDB on Centos 7.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles

POPULAR TAGS

Most Popular