MariaDB is a community-developed fork of the MySQL relational database management system intended to remain free under the GNU GPL. Development is led by some of the original developers of MySQL, who forked it due to concerns over its acquisition by Oracle Corporation. Contributors are required to share their copyright with the MariaDB Foundation.
MariaDB Server is one of the most popular database servers in the world. It’s made by the original developers of MySQL and guaranteed to stay open source. Notable users include Wikipedia, WordPress.com and Google. It is the default package on CentOS 7 and at the time of writing this guide, the current stable release version is 10.3.7.
In this guide, we will explain how to install the latest version of MariaDB on a CentOS 7 server.
You can read the guide on installing MariaDB on an Ubuntu Server here
Deploying your cloud server
If you have not already registered with Cloudwafer, you should begin by getting signed up. Take a moment to create an account after which you can easily deploy your own cloud servers.
Step 1: Install MariaDB
Type the command below to Yum to install the MariaDB package, pressing y when prompted to confirm that we wish to proceed:
sudo yum install mariadb-server
After the installation has been completed, enable mariadb to start on boot then start the service with the following commands:
sudo systemctl enable mariadb sudo systemctl start mariadb
To check the status of Maridb, type the following command below:
sudo systemctl status mariadb
Step 2: Securing the MariaDB Server
The next step is to secure our new installation. MariaDB includes a security script to change some of the less secure default options. Type the command below to run the security script:
The script provides a detailed explanation for every step. The first prompt requests for the root password, which hasn't been set so we'll press ENTER as it recommends.
Next, we'll be prompted to set that root password, which is up to you to decide.
Then, we'll accept all the security suggestions by pressing Y and then ENTER for the remaining prompts, which will remove anonymous users, disallow remote root login, remove the test database, and reload the privilege tables.
Step 3: Testing
After securing the database server, we can verify MariaDB is working as needed.
Type the command below to check the version installed:
We can also use the mysqladmin tool, a client that lets you run administrative commands by typing the command:
mysqladmin -u root -p version
This indicates the installation has been successful.