The MariaDB database is a multi-user, multi-threaded SQL database server that consists of the MariaDB server daemon ( mysqld ) and many client programs and libraries. In Red Hat Enterprise Linux, the mariadb-server package provides MariaDB.
Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform MariaDB server installation and configuration task.
In this context, we shall look into how to install the latest version of MariaDB SQL Server database on your CentOS 8 system.
We will also explore how to start MariaDB services on CentOS 8.
How to install MariaDB SQL server on CentOS 8 ?
To begin, ensure that you have root access to the server with sudo privileges.
Then, Access the terminal by clicking on the ‘Activities’ and further click on the 'Terminal' icon from the left sidebar.
Now, you can follow the steps given below to install MariaDB server on your CentOS 8 system.
1. Install MariaDB
Now, type the following command to install the MariaDB server version 10.3.17:
$ sudo yum install mariadb-server
During the installation, it will prompt you that either you want to continue the installation further or not. Press 'y' to complete the installation of MariaDB.
2. Enable MariaDB Services
Once the installation of the MariaDB server is completed, you will enable its services by running the below-given command:
$ sudo systemctl enable mariadb.service
3. Start MariaDB services
Start the services by using the following command:
$ sudo systemctl start mariadb.service
$ sudo systemctl restart mariadb.service
Now, check the running status of MariaDB services by using the following command:
$ sudo systemctl status mariadb.service
4. Secure MariaDB Installation
To make the installation of the MariaDB server more secure, run the below mentioned command on the terminal:
$ sudo mysql_secure_installation
Set the root password during the installation and you need to press 'y' to confirm all the necessary questions.
Now, you will log in to the MariaDB server as the root user.
Type the following command to login into the MariaDB server as the root user:
$ mysql -u root –p
Using the following command, you can also view the list of all databases:
> show databases
To exit from the MariaDB server environment type the following command:
After executing the above command, you will notice that the current MariaDB environment is closed now.
How to uninstall Mariadb from CentOS 8 ?
To remove mariadb from your CentOS system, use the following command:
$ sudo yum remove mariadb-server mariadb-client
This will not remove the mariadb directories from your system.
Therefore, to remove all directories run the below mentioned command:
$ sudo rm –r /var/lib/mysql
[Need urgent assistance to install Missing packages on CentOS Linux System ? We are available to help you. ]