MySQL

Store and query relational data in a persistent MySQL database.

  • database
  • sql

Guide: Connect to a database from outside

Run it

briq run mysql

Fields

NameTypeOptionsDefault
imagestring—"mysql:8.4"
envrecord{ key: string | { secret, value?, literal?, scope?, hosts?, locations? } }{}
cmdstring | string[]——
sizeenumpico, micro, nano, small, medium, large, xlarge"small"
volumeobject{ gb? }{"gb":2}
filesrecord{ key: string | { base64 } }—
egressobject{ hosts }—

Outputs

Returned by briq_run once the stack is healthy. Hosts resolve inside your team network; secrets are generated per run.

DATABASE_URL
mysql://root:<MYSQL_ROOT_PASSWORD>@mysql.<stack>.internal:3306/app
MYSQL_HOST
mysql.<stack>.internal
MYSQL_PORT
3306
MYSQL_USER
root
MYSQL_PASSWORD
<MYSQL_ROOT_PASSWORD>
MYSQL_DATABASE
app

What it runs

BriqImagePortsSizeVolume
mysqlmysql:8.43306small2 GB at /var/lib/mysql

When to use it

  • Your app targets MySQL or MariaDB and migrations must be checked against the real dialect.
  • A test suite expects a mysql:// DATABASE_URL.

Tips

  • First boot is slow: MySQL initialises its data directory, so briq_run can take 30 to 60 seconds. Later starts are fast.
  • Root only, with a generated password (MYSQL_ROOT_PASSWORD inside the briq). Create least-privilege users with briq_exec: sh -c 'mysql -uroot -p"$MYSQL_ROOT_PASSWORD" -e "create user …"'.
  • Import a dump: briq_files_put it to /dump.sql, then briq_exec with sh -c 'mysql -uroot -p"$MYSQL_ROOT_PASSWORD" app < /dump.sql'.
  • Connect from outside: briq_expose port 3306 with protocol: "mysql". The mysql CLI needs 8.1 or later and --tls-sni-servername. See Connect to a database from outside.
  • Bigger dataset? The volume starts small: set volume: { gb: 20 }. Set it when the briq is created, and it counts toward your plan's disk.

On this page

Free to try

Try briq, on us.

Every new account starts with €10 of credits. No card.

Start building

How can we help?

Message to the briq team