How to Install MariaDB on CentOS 7 VPS VULTR

Forked from MySQL, MariaDB has been known to be a drop-in replacement that brings enhancements and performance optimizations over MySQL. This tutorial will show you how to install MariaDB onto CentOS 7 in two different ways.

Step 1: Download/install MariaDB

Install from repository

MariaDB is shipped in the CentOS repo as of CentOS 7. Anything lower will need require you to add the additional repository to your server. Run the following command on your server:

You may also need to finish the installation by running:

This will install MariaDB and walk you through the process of setting up your root password.

Manual install from MariaDB mirror (latest version)

This should be straightforward. You will need to create a file in /etc/yum.repos.d/and add the following:

Once the file is created, run the following commands:

You can then finish the installation by running:

If everything was successful, proceed to the next step.

Step 2: Verify that MariaDB is operational

Depending on if you are using the default Vultr image of CentOS 7 or if you are using a Custom ISO, you may need to manually start MariaDB and enable it to start on boot of the server. To do so, run:

You can check to see if everything is running by executing the following command:

After installation, run mysql -u root -p. Enter your password when prompted. You will see output similar to the following:

Congratulations, you have successfully installed MariaDB on CentOS 7. If you get an error regarding connection, please make sure that MariaDB is running by repeating the beginning of Step 2. Enjoy!

Leave a Reply

Your email address will not be published.