Install MariaDB server via APT
apt install mariadb-server
Create a firewall rule to allow the server to listen for new connections
(It would be best to specify the source and destination addresses for better access control)
ufw allow from any to any port 3306 proto tcp
Run the installation script
mysql_secure_installation
Follow the prompts - read them clearly
Change the server config to listen to all interfaces (not just localhost)
vim /etc/mysql/mariadb.conf.d/50-server.cnf
Change the bind-address
from 127.0.0.1 to 0.0.0.0
bind-address = 127.0.0.1
bind-address = 0.0.0.0
Login as root (if logged in as the Unix root user, specifying a password won't be required)
mysql -u root -p
Set a default schema
Create a new user
The %
allows the user to connect to any bound interface on the server; it can be 127.0.0.1 for local access only
CREATE USER 'ross'@'%' IDENTIFIED BY '********';