An automated method that doesn't require much typing can be found [ here ]
Run the following using sudo or root.
apt update apt install -y mariadb-server mariadb-client systemctl start mariadb.service mysql_secure_installation
Apply the following when running mysql_secure_installation
Enter current password for root (enter for none): press enter Switch to unix_socket authentication [Y/n] press n Change the root password? [Y/n] press y New password: enter new root password Re-enter new password: enter new root password again Remove anonymous users? press y Disallow root login remotely? press y Remove test database and access to it? press y Reload privilege tables now? press y
Tweak your config as you see fit. I normally add the following as a bare minimum. Listen on all interfaces and skip-name-resolve for performance.
vi /etc/mysql/mariadb.conf.d/50-server.cnf
Find this line:
bind-address = 127.0.0.1
Change it to:
bind-address = 0.0.0.0
Add the folowing somewhere under [mysqld]
# custom sql settings skip-name-resolve # custom sql settings
Restart mariadb for changes to take effect.
systemctl restart mariadb