briqbriq

MySQL

A MySQL database with a persistent volume.

  • database
  • sql

Guide: Connect to a database from outside

Run it

briq_run({
  recipe: "mysql",
  params: {
    "version": "8.4",
    "database": "app",
    "size": "small",
    "diskGb": 2
  },
  wait: true
})

Parameters

NameTypeOptionsDefault
versionenum8.0, 8.4, 9"8.4"
databasestring—"app"
sizeenumnano, small, medium, large"small"
diskGbnumber—2

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: pass diskGb, e.g. params: { diskGb: 20 }. Set it when the briq is created, and it counts toward your plan's disk.

On this page

Free to try

Let your agent try it, on us.

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

Connect your agent

How can we help?

Message to the briq team
hello@briq.cloud