MySQL
MySQL setup, MYSQL_ reference variables, Expose, and dashboard actions.
Written By Zoro
Last updated 28 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
- Applications → your app → Environment.
- Add New → Add service → Database → MySQL.
- Name the service → Create Service → open it → Deploy.
- 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 }}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, and Expose / Unexpose behave like other database services: actions queue on the server, Stop requires Unexpose first when exposed, and Deploy disappears from the UI after the first successful deployment. See Where things live in the dashboard.