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.
In this guide, we will explain how to install the latest version of MariaDB on an Ubuntu 18.10 server.
You can read the guide on installing MariaDB on a CentOS 7 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 install the MariaDB package, pressing y when prompted to confirm that we wish to proceed:
sudo apt install mariadb-server mariadb-client
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 Mariadb, 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:
Both will return the same result.
We can also use the
mysqladmin tool, a client that lets you run administrative commands by typing the command:
sudo mysqladmin -u root -p version
This indicates the installation has been successful.