How to Install MariaDB on Ubuntu 16

If you plan on adding a relational database integration to your site, you will need to install a database management program. The open-source MariaDB installation is a popular alternative to MySQL. In this article, we’ll show how to install MariaDB on your Ubuntu Cloud VPS.

How to Install MariaDB

As is common practice, you will want to make sure the packages in your package manager are up to date:

sudo apt-get update

Next, run the installation command for MariaDB:

sudo apt-get install mariadb-server

Once you’ve answered “Yes” (Y) to the prompt, the installation will proceed.

We can verify the services are running as intended with this command:

sudo service mysql start

If you see no errors, this means MariaDB (which is a drop-in replacement for MySQL is running).

You can log into MariaDB the same way you would with MySQL:

mysql -u root -p

After which, you will be prompted for the password for the MySQL root user.

Was this article helpful? Let us know!