How to Install MariaDB on Ubuntu 16

Try it in our public cloud & Get $5 Credit
CLAIM NOW

MariaDB is a backwards-compatible MySQL community fork with many enhancements. For starters, it includes a variety of additional storage engines, including some with NoSQL and graph capabilities. It also features various performance enhancements, along with high availability features that typically make it the superior choice for integrating with MySQL applications. Since it is MySQL-compatible, it can capitalize on the large ecosystem of MySQL extensions and apps, making it a drop-in replacement for MySQL in many circumstances. If you’re in a situation where MySQL is your performance bottleneck, updating to MariaDB may be the perfect solution. Not only might one of its many storage engines be a better fit for your workload, but you may be able to add in additional database instances to horizontally scale performance.

Getting Started

To complete this guide, you will need the following:
• 1 Node (Cloud Server or Dedicated Server) running a clean installation of Ubuntu 16.

When this installation is complete, you can continue on and install apps or services that depend on MySQL, or can build out your installation by creating additional servers to cluster together.

Tutorial

Begin by updating your Ubuntu installation. We’ll upgrade the list of packages, and will also apply any current security patches and bugfixes. This step should be done regularly to keep your server secure and performant. Neglecting to do so may result in security breaches or other system issues.

apt-get update && apt-get upgrade -y

We’ll now install the MariaDB server package.

apt-get install mariadb-server -y

With MariaDB installed, we must now turn to security. The next step will perform some basic hardening on the newly-installed database server.

mysql_secure_installation

Let’s see if the database server itself is working.

mysql -u root -p

Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 50
Server version: 10.0.25-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>

Conclusion

You now have a single-node, secure instance. It is ready to integrate with any MySQL-compatible apps, or to be clustered with other instances in a highly-available setup. If this guide was helpful to you, kindly share it with others who may also be interested.