Skip to main content

Install MariaDB

Install MariaDB

sudo apt install -y mariadb-server mariadb-client

Allow remote access if needed

To allow remote access we need to change the bound IP address for MariaDB. Edit the configuration file:

sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf

Find the bind-address line and change the IP from 127.0.0.1 to 0.0.0.0 and it should look like this:

bind-address            = 0.0.0.0

Enable MariaDB to run as a system service

sudo systemctl enable mariadb

Secure the installation

sudo mysql_secure_installation

Allow remote access if needed

To allow remote access we need to change the bound IP address for MariaDB. Edit the configuration file:

sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf

Find the bind-address line and change the IP from 127.0.0.1 to 0.0.0.0 and it should look like this:

bind-address            = 0.0.0.0