← Databases
MY

MySQL

Tick MySQL on an app and Railyard creates a database, a user, and injects the connection details before the next build runs. Here is exactly what that gives you, what gets backed up, and how to reach it from outside.

What you get

  • MySQL 8 (mysql:8), one database and one user per app (app_<id>), created with CREATE DATABASE and CREATE USER and granted privileges on its own database plus any pattern-matched extra databases the app declares.
  • Scheduled backups every 24 hours by default, each one confirmed by restoring it. At least the 7 most recent are always kept, and anything older than 30 days outside that set is pruned; both numbers are configurable per database.
  • A standby on a second database server (Pro and Team) keeps a live copy and takes over automatically if the primary stops answering for 3 minutes, the same mechanism as Postgres.
  • No point-in-time recovery for MySQL, that's Postgres-only.
  • MariaDB is available as a drop-in alternative from the templates catalog if you want the same wire protocol under a community-governed fork.

How to add it

  1. 1

    Tick MySQL when you create the app

    On New app, or later from Edit → Add-ons, check MySQL and deploy. Railyard injects DATABASE_URL, DATABASE_HOST, DATABASE_PORT, DATABASE_NAME, DATABASE_USER and DATABASE_PASSWORD before the build runs.

  2. 2

    Or add it from the CLI

    railyard apps create <name> <git-url> --addons mysql does the same thing from a terminal.

  3. 3

    Connect from your own machine

    Open Trusted addresses on the database card and allow your IP. Railyard opens a TCP proxy for that one address; any MySQL client can then reach it with the same password, and the card gives you the exact command to paste.

A one-click example

Ghost is a full publishing platform that expects MySQL out of the box, a direct example of an app running against the add-on instead of an empty database with nothing pointed at it.

Deploy Ghost Free plan, no card.

Or deploy a standalone instance deploys a standalone MySQL instance with nothing else attached, if that's all you need.

FAQ

What does MySQL cost on Railyard?
There's no separate line item. MySQL runs on the server you're already paying for, on your plan. A dedicated database server is its own server at normal pricing, and a standby for automatic failover needs Pro or Team.
How are backups kept, and can I restore one myself?
Every database on a database server is backed up on a schedule, 24 hours by default, and each backup is restored into a scratch database to confirm it's actually good before being marked verified. Restoring to the running app is one click from the database card.
How do I connect from outside, with a GUI or the mysql client?
Open Trusted addresses on the database card and add your IP. Railyard opens a TCP proxy for that one address only; every other address stays blocked and the password is still required. The card shows you the exact connection string to paste.
How do I migrate an existing MySQL database in?
Point the app at the external URL under Resources → Use an outside service while you copy data across, or run mysqldump against your old database and pipe it into the generated DATABASE_URL directly.

Tutorials that use it

General docs