The Architecture Rationale
While MariaDB serves as a highly compatible community fork, certain legacy applications, specific enterprise frameworks, and platform-dependent database structures require native MySQL compatibility. To avoid resource conflicts and maintain granular environment controls, I deploy MySQL in its own dedicated Ubuntu LXC container. This keeps the execution context separated from PostgreSQL and MariaDB, while maintaining a predictable local networking map.
Phase 1: OS Provisioning & Package Installation
The container is built on a clean, stable Ubuntu instance via Proxmox Helper-Scripts.
Once the container is operational, the OS package repository is refreshed, and the latest stable MySQL server packages are installed:
Bash
# Refresh apt cache and install the MySQL server package
apt update
apt install mysql-server -y
# Enable the service to start automatically on system boot
systemctl enable mysql
systemctl start mysql
# Verify the operational status of the service daemon
systemctl status mysql
Phase 2: Administrative Security & Remote Access
By default, MySQL restricts database root execution to local OS-level socket authentication. To leverage this database instance as a centralized server for orchestrators and containerized applications across the local network, we must reconfigure user authorization and grant remote access.
1. SQL Authentication Hardening
Log into the MySQL server console interface:
Bash
mysql -u root -p
Inside the MySQL prompt, run the following commands to harden administrative credentials and grant global network-level connectivity:
SQL
-- Update root authentication on localhost with a strong security key
ALTER USER 'root'@'localhost' IDENTIFIED BY 'YOUR_SECURE_PASSWORD';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost';
-- Create a network-wide administrative user for internal orchestration
CREATE USER 'root'@'%' IDENTIFIED BY 'YOUR_SECURE_PASSWORD';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
-- Clear query cache and commit changes
FLUSH PRIVILEGES;
EXIT;
Phase 3: Exposing the Database Interface to the LAN
By default, the MySQL server daemon is strictly configured to bind only to the local loopback interface (127.0.0.1). To accept client connections from internal orchestrators (like n8n or Dokploy), you must instruct the daemon to listen on all interfaces.
Network Binding Modification
Open the main configuration file in your editor:
Bash
nano /etc/mysql/mysql.conf.d/mysqld.cnf
Locate the bind-address configuration option, uncomment it, and set the value to 0.0.0.0:
Ini, TOML
# Listen on all active network interfaces
bind-address = 0.0.0.0
Save and close the file, then restart the service to apply the modified network binding:
Bash
systemctl restart mysql
systemctl status mysql
Phase 4: Comparative Integration Stack
To make the database ecosystem clear, the table below maps how each RDBMS solution is integrated across the self-hosted network:
| Engine | Ideal Integration Profile | Native Port | Primary Portfolio Node |
| MySQL | Legacy enterprise tools, specialized web platforms | 3306 | Ubuntu LXC |
| MariaDB | Performance-optimized web apps, CMS systems, general storage | 3306 | Alpine/Debian LXC |
| PostgreSQL | Stateful automation engines (n8n), highly relational schema workloads | 5432 | Debian LXC |
