Skip to content

Commit 99c56f2

Browse files
authored
Merge pull request #45 from lbajsarowicz/docs/database-distribution-selection
docs: add database distribution selection guide
2 parents 5422dde + b5bfc4b commit 99c56f2

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

environments/customizing.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ To configure your project with a non-default PHP version, add the following to t
66

77
PHP_VERSION=7.2
88

9-
The versions of MariaDB, Elasticsearch, Varnish, Redis, NodeJS and Composer may also be similarly configured using variables in the `.env` file:
9+
The versions of Elasticsearch, Varnish, Redis, NodeJS and Composer may also be similarly configured using variables in the `.env` file:
1010

11-
* `MARIADB_VERSION`
1211
* `ELASTICSEARCH_VERSION`
1312
* `REDIS_VERSION`
1413
* `VALKEY_VERSION`
@@ -17,6 +16,33 @@ The versions of MariaDB, Elasticsearch, Varnish, Redis, NodeJS and Composer may
1716
* `NODE_VERSION`
1817
* `COMPOSER_VERSION`
1918

19+
## Database
20+
21+
Warden supports both **MariaDB** (default) and **MySQL** as the database engine. The distribution and version are controlled via two environment variables in your project's `.env` file:
22+
23+
* `MYSQL_DISTRIBUTION` — set to `mariadb` (default) or `mysql`
24+
* `MYSQL_DISTRIBUTION_VERSION` — the image tag/version to use
25+
26+
For example, to use MariaDB 11.4:
27+
28+
MYSQL_DISTRIBUTION=mariadb
29+
MYSQL_DISTRIBUTION_VERSION=11.4
30+
31+
To use MySQL 8.4 instead:
32+
33+
MYSQL_DISTRIBUTION=mysql
34+
MYSQL_DISTRIBUTION_VERSION=8.4
35+
36+
:::{note}
37+
Drupal and CakePHP environments use `DB_DISTRIBUTION` and `DB_DISTRIBUTION_VERSION` instead of the `MYSQL_` prefix. The values and behavior are the same.
38+
:::
39+
40+
After changing the database distribution or version, run `warden env up` to re-create the database container.
41+
42+
:::{warning}
43+
Switching distributions (e.g. from MariaDB to MySQL) is **not** a drop-in replacement for existing data volumes. If you change the distribution on an existing environment, you should export your database first, remove the db volume (`warden env down -v`), and re-import after the new container is running.
44+
:::
45+
2046
Start of some environments could be skipped by using variables in `.env` file:
2147

2248
* `WARDEN_DB=0`

0 commit comments

Comments
 (0)