MariaDB
Run MariaDB, the MySQL-compatible database, with its users and grants declared in doze.hcl.
On this page
Runs MariaDB 11 · macOS and Linux · registry page ↗
Run a MySQL-compatible database for your app, with its users and grants declared beside it.
MariaDB is the community fork of MySQL, begun by MySQL’s original authors and
licensed GPLv2. It speaks the MySQL protocol, so mysql:// drivers, the
mysql and mariadb clients, and GUIs connect unchanged.
A database
Section titled “A database”module mariadb "db" { version = "11.4"}The database is named after the block and created on the first start.
doze url dbHand it to an app by reference: DATABASE_URL = module.db.url.
Users and grants
Section titled “Users and grants”module mariadb "app" { version = "11.4" character_set = "utf8mb4"
user "app" { password = "secret" host = "%" }
grant { user = "app" privileges = ["ALL PRIVILEGES"] database = "app" }}An app that logs in as app builds its URL around the address:
app "api" { run = "php artisan serve --port=$PORT" port = 8000 env = { DATABASE_URL = "mysql://app:secret@${module.app.address}/app" }}Server settings
Section titled “Server settings”settings adds lines to the [mysqld] section of the server’s config:
module mariadb "db" { version = "11.4" settings = { max_connections = "50" }}Reference
Section titled “Reference”A socket-only MariaDB backend behind the doze proxy, with declarative databases, users, and grants. The instance database is created automatically; connect via DATABASE_URL.
Every field at once
Section titled “Every field at once”module mariadb "app" { version = "11.4" character_set = "utf8mb4"
user "app" { password = "secret" host = "%" } grant { user = "app" privileges = ["ALL PRIVILEGES"] database = "app" }}Versions you can declare
Section titled “Versions you can declare”The version = you write is the engine’s own version. Declare a series and
doze pins its newest published build, or declare an exact build. Either way it
is fetched, verified and pinned in doze.lock, so it never moves on its own.
version = |
pins (today) | exact builds |
|---|---|---|
11.4 |
11.4.13 |
12 |
11.8 |
11.8.9 |
8 |
Every exact build, per series
11.4: 11.4.13 · 11.4.12 · 11.4.11 · 11.4.10 · 11.4.9 · 11.4.8 · 11.4.7 · 11.4.6 · 11.4.5 · 11.4.4 · 11.4.3 · 11.4.2
11.8: 11.8.9 · 11.8.8 · 11.8.7 · 11.8.6 · 11.8.5 · 11.8.4 · 11.8.3 · 11.8.2
The binaries mirror also publishes 12.0 · 12.1 · 12.2 · 12.3: declarable once the module supports those series.
Fields
Section titled “Fields”| Field | Type | Default | Description |
|---|---|---|---|
version |
string | — | MariaDB server version (e.g. 11.4) Required. |
character_set |
string | — | default charset for the instance database (e.g. utf8mb4) |
collation |
string | — | default collation for the instance database |
settings |
map(string) | — | extra [mysqld] my.cnf entries |
Every module block also takes doze’s own fields: port, listen, sleep,
after, enabled, routes, count and for_each
(doze.hcl reference).
Nested blocks
Section titled “Nested blocks”user "<name>" { … } — a MariaDB account (repeatable; label = name; host, password)
The module does not list this block’s fields yet.
grant { … } — a privilege grant (user, privileges, database, table)
The module does not list this block’s fields yet.
Module releases
Section titled “Module releases”The releases of the module that provide this engine. doze picks the newest
one that fits your doze and your version =, and pins it in doze.lock;
you never write these. Older releases stay available for pinned lockfiles.
| Release | Engine versions | Platforms | |
|---|---|---|---|
0.2.1 |
11 | 3 | stable |
Signed data: index.yaml ↗ · meta.yaml ↗