MariaDB server installation CentOS 8
Enjoying this content? Subscribe to the Channel!
Lightning Fast: Install MariaDB Server on CentOS 8 (Step-by-Step Guide!)
Hi there! This is Darren Neal from Darren’s Tech Tutorials, and I’m thrilled to guide you through installing one of the most popular open-source database engines available: MariaDB Server.
MariaDB is a powerful, fully open-source database that started as a fork of the famous MySQL database. They are highly compatible, but MariaDB is often preferred for its strong community backing and dedication to openness.
If you’re running a Red Hat-based system like CentOS 8 (or similar distributions like Fedora or RHEL), this guide will walk you through the entire installation process quickly and efficiently.
Let’s dive right in and get your new database engine up and running!
Prerequisites
Before we begin, make sure you have:
- A CentOS 8 installation.
- Sudo access (we will be running commands as root).
Step 1: Installing the Core MariaDB Package
The first step is to install the basic MariaDB package. This package provides the necessary client tools and libraries we need to interact with the database.
Open your terminal and execute the following yum command:
sudo yum install mariadb
When prompted to continue the installation, type y and hit Enter. The system will go out, check the repositories, download the package, and install it on your system.
Step 2: Installing the MariaDB Server
While the base package handles the client side, we need to install the server package to get the actual database daemon running. This package contains all the files needed to manage and serve your data.
Use the following command to install the server components:
sudo yum install mariadb-server
Again, you will be prompted to confirm the package installation. Press y to continue.
Step 3: Checking and Starting the MariaDB Service
Once both packages are installed, the MariaDB service needs to be initialized and started. We use systemctl to manage system services on CentOS.
First, let’s check the current status of the MariaDB service. It is often inactive right after installation:
sudo systemctl status mariadb
You should see output indicating that the service is inactive or “dead.”
Now, let’s bring the service to life! Use the start command:
sudo systemctl start mariadb
Pro Tip: To ensure that MariaDB starts automatically every time your server reboots, you should also run:
sudo systemctl enable mariadb
Step 4: Verifying the Service is Running
Now that we’ve told the system to start the database engine, let’s quickly confirm that it’s running smoothly.
Run the status check command again:
sudo systemctl status mariadb
If everything worked correctly, the output should now show Active: active (running). Fantastic! Press Ctrl + C to exit the status view.
Step 5: Quick Login and Verification Test
To ensure that the installation is completely successful, let’s log into the MariaDB environment using the command line client.
By default, the MariaDB root user is created during installation with no password set (you will configure a secure password later using mysql_secure_installation, which is a recommended next step).
Log in using the following command:
mysql -u root -p
Since there is no initial password, just hit Enter when prompted for the password.
You should now see the MariaDB prompt! We can test it by creating a simple database named ‘darren’:
CREATE DATABASE darren;
To confirm it was created, list all databases:
SHOW DATABASES;
If you see darren listed in the output, congratulations—your MariaDB server is fully operational! Type exit; to log out of the MariaDB shell.
Conclusion
That’s all there is to it! You have successfully installed and verified MariaDB Server on your CentOS 8 system. You now have a robust, open-source database engine ready to power your applications and projects.
What do you plan to build with your new database? Let me know in the comments below!
If you found this tutorial useful, please hit that Like button and Subscribe to Darren’s Tech Tutorials for more clear, accessible technology guides. Thank you for watching!