How to Install MariaDB on CentOS 7

MariaDB is a popular open-source database management system, often used as a replacement for MySQL. This step by step guide will walk you through the installation of MariaDB on CentOS 7.

Updating System Packages

Start by updating your system’s packages:

sudo yum update -y

Installing MariaDB

Install MariaDB using the CentOS package manager:

sudo yum install mariadb-server mariadb -y

Starting and Enabling MariaDB

Enable and start the MariaDB service:

sudo systemctl start mariadb
sudo systemctl enable mariadb

Securing MariaDB

Run the `mysql_secure_installation` script to secure your database:

sudo mysql_secure_installation

Follow the prompts to set a root password, remove anonymous users, disallow root login remotely, and remove the test database.

Accessing MariaDB

Access the MariaDB shell:

mysql -u root -p

Enter your root password when prompted.

MariaDB is now installed and secured on your CentOS 7 server. It’s ready for use in your applications or websites that require a database management system.

About the author

Technical Sahil

Hello I’m Sahil, May be most of you guys know me as Technical Sahil on YouTube. Founder of Hostrigger & Mailracle and running several other things online.

View all posts

Leave a Reply

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