MariaDB is an open-source relational database management system, backward compatible, binary drop-in replacement of MySQL. In addition, it is developed by some of the original developers of MySQL and by many contributors from the community.
In this tutorial, we will explain how to install and secure MariaDB 10 on CentOS 8.
Installing MariaDB on CentOS 8
01- Run the following command as root or user with sudo
privileges to install MariaDB 10.3 on CentOS 8:
$ sudo dnf install @mariadb
02- Once the installation is complete, start the MariaDB service and enable it to automatically start on boot by typing:
$ sudo systemctl enable --now mariadb
03- To verify that the MariaDB server is running, type:
$ sudo systemctl status mariadb
Securing MariaDB Server
MariaDB server package comes with a script called mysql_secure_installation
performs several security-related operations, and sets the root password.
Connecting to the MariaDB from Command Line
01- Now, type the below command to connect to the MariaDB server through the terminal as the root account:
$ mysql -u root -p
02- Finally, enter the password of the root user account, and you will get the MariaDB shell, as shown below:
Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 18 Server version: 10.3.11-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)]>
Conclusion
In this tutorial, we’ve shown you how to install MariaDB Server on CentOS 8. In adittion, how to secure your MariaDB Server using mysql_secure_installation tool and also how to connect to the MariaDB server from the command line.
You might want to check the following guides:
We hope this tutorial was enough Helpful. If you need more information, or have any questions, just comment below and we will be glad to assist you!