MariaDB is an open-source relational database management system, backward compatible, binary drop-in replacement of MySQL. It is developed by some of the original developers of the MySQL and by many people in the community. With the release of CentOS 7, MySQL was replaced with MariaDB as the default database system.
If you, for any reason need to install MySQL, check the How to Install MySQL on CentOS 7 tutorial. If your application does not have any specific requirements, you should stick with MariaDB, the default database system in CentOS 7.
In this tutorial we will show you how to install the latest version of MariaDB on CentOS 7 using the official MariaDB repositories.
Prerequisites
Make sure you are logged in as a user with sudo privileges before proceeding with the tutorial.
Install MariaDB 5.5 on CentOS 7: The version of the MariaDB server provided in default CentOS repositories is version 5.5. This is not the latest version though, but it is quite stable.
Follow the steps below to install and secure MariaDB 5.5 on CentOS 7:
Install the MariaDB package using the yum package manager:
sudo yum install mariadb-server
Press y when prompted to proceed with the installation. Once the installation is complete, start the MariaDB service and enable it to start on boot using the following commands:
sudo systemctl start mariadbsudo systemctl enable mariadb
To verify that the installation was successful, check the MariaDB service status by typing:
sudo systemctl status mariadb
The output should show that the service is active and running:
Read more