MySQL

Add MySQL in dFlow, deploy it, use internal credentials or reference variables, and optionally expose it for external tools.

Written By Team dFlow

Last updated 3 days ago

MySQL is one of the world’s most common SQL databases, solid for web apps, reporting, and anything that speaks MySQL clients and drivers.

Start here if you’re new: Databases overview


On this page

  • When MySQL is a good fit

  • Creating and deploying in dFlow

  • Connection URL and fields on Overview

  • Reference variables (MYSQL_…)

  • Expose for the internet

  • Restart and stop


When to choose MySQL

Pick MySQL when your app, team, or tooling expects MySQL specifically. For a MySQL-compatible alternative with a different feature set, compare MariaDB on its guide.


Set up MySQL in dFlow

  1. Applications → your app → Environment.

  2. Add NewAdd serviceDatabaseMySQL.

  3. Name the service → Create Service → open it → Deploy.

  4. Wait until Deploy completes. Server setup is automatic.


Your connection details

After a successful deploy, Overview shows Internal credentials:

  • A connection URL (typically mysql://… with user, password, host, port, and database).

  • The same details as separate fields if your client needs them.

Use these for services in the same environment. Public credentials appear only after Expose; use Unexpose before Stop if you exposed it.


Link your app with reference variables

In an app or Docker service, open the Variables tab and use the { } Reference variables menu. Replace my-mysql with your service name:

{{ my-mysql.MYSQL_URI }}

Suffix

What it fills in

_URI

Internal URL

_NAME

Database name

_USERNAME

User

_PASSWORD

Password

_HOST

Internal host

_PORT

Internal port

_PUBLIC_HOST, _PUBLIC_PORT, _PUBLIC_URI

After Expose


Internet access (Expose)

Expose gives you one public port through dFlow’s routing so external clients can connect. Prefer internal URLs for app traffic inside dFlow.

Unexpose before Stop when the database was exposed.


Day-to-day management

Restart, Stop, Expose, and Unexpose work like other databases.


Useful links