MagicHosting Logo
Back to blog

Magichosting

MariaDB/MySQL remote access: change bind-address and open port 3306

E
Elias Bieber
Estimated reading time: 1 min

Make your database reachable from outside: set bind-address to 0.0.0.0, restart MariaDB, open UFW port 3306 – plus security tips for production.

MariaDBMySQLDatabaseLinuxFirewall

Change bind-address

Open config:

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

Change line bind-address = 127.0.0.1 to:

bind-address = 0.0.0.0

Save (Ctrl+X, Y, Enter). Restart MariaDB:

service mysql restart
  • Firewall: Open port 3306: <code>ufw allow 3306</code>
  • Security: Use strong passwords; restrict access by IP if possible.

Was this post helpful?

MagicHosting – Hosting with real value

Hosting pays off with MagicHosting: fair pricing, current deals and reliable operation from Frankfurt. We offer servers, domains and personal support – no hidden costs.

  • Current special sales with discounts on servers and packages
  • Affordable domains with transparent pricing and great offers
  • Powerful DDoS protection for maximum availability
  • Personal support when you have questions or issues
Contact on WhatsApp