Skip to content
Live $300 credit for new accounts Valid for 60 days from account creation Get started →

MariaDB 11.4

MariaDB is an open-source relational database management system and a drop-in replacement for MySQL. It is widely used for web applications, content management systems, and general-purpose data storage.

ComponentVersion
MariaDB Server11.4.x (LTS)
Ubuntu24.04 LTS
ssh ubuntu@<your-vm-ip>

On the first boot, a setup script runs automatically. It:

  • Sets a random root password
  • Removes anonymous users and the test database
  • Creates an app database and an app user with a random password
  • Writes all credentials to /etc/mariadb/credentials.txt
  • Configures /root/.my.cnf so root can connect without typing a password

This takes under 30 seconds. Track progress:

journalctl -u mariadb-first-boot.service -f
sudo cat /etc/mariadb/credentials.txt

This file contains the root password, application database name, application user, and application password. It is only readable by root.

As root (no password prompt):

sudo mariadb

As the application user:

APP_PASS=$(sudo awk '/^Application password:/{print $NF}' /etc/mariadb/credentials.txt)
mariadb -u app -p"$APP_PASS" app
# Check service status
systemctl status mariadb
# Restart
sudo systemctl restart mariadb
# View logs
sudo journalctl -u mariadb -f

Configuration directory: /etc/mysql/mariadb.conf.d/

To allow remote connections, edit /etc/mysql/mariadb.conf.d/50-server.cnf and change bind-address from 127.0.0.1 to 0.0.0.0, then restart MariaDB. Open the firewall for specific IPs only (see Security).

Port 3306 is not open externally by default. UFW is enabled and allows SSH (port 22) only.

To allow access from a specific IP:

sudo ufw allow from <trusted-ip> to any port 3306

To connect without opening the firewall (recommended), use an SSH tunnel:

# Run this on your local machine
ssh -L 3306:localhost:3306 ubuntu@<your-vm-ip>
# Then connect locally
mariadb -u app -p"<app-password>" app