Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions docs/install/databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ services:

## Binary logging and trigger privileges

RomM's migrations create triggers on the `roms` table. MariaDB and MySQL refuse trigger DDL when binary logging is enabled and the connecting user lacks `SUPER`, so the container aborts during startup with:
RomM's migrations create triggers on the `roms` table. MariaDB refuses trigger DDL when binary logging is enabled and the connecting user lacks `SUPER`, so the container aborts during startup with:

```text
sqlalchemy.exc.OperationalError: (mariadb.OperationalError) You do not have the SUPER
Expand All @@ -77,7 +77,7 @@ log_bin_trust_function_creators variable)
ERROR: [RomM][init] Failed to run database migrations
```

This mainly affects external or managed database servers, because binary logging is on by default on MySQL 8 and is commonly enabled on hardened or replicated MariaDB instances. The `mariadb:11` container from the reference Compose is not affected out of the box.
This mainly affects external or managed database servers, where binary logging is commonly enabled on hardened or replicated instances. The `mariadb:11` container from the reference Compose is not affected out of the box, and neither is MySQL 8.0.22 or newer, which no longer requires `SUPER` for trigger DDL.

Both fixes below have to be applied by an admin or root database user rather than the RomM user. The quickest one sets the global flag, though it is lost when the database restarts:

Expand All @@ -92,11 +92,10 @@ To make it survive a restart, add it under `[mysqld]` in the server's option fil
log_bin_trust_function_creators = 1
```

Alternatively, grant the privilege to the RomM user itself:
Alternatively, grant `SUPER` to the RomM user itself:

```sql
GRANT BINLOG ADMIN ON *.* TO 'romm-user'@'%'; -- MariaDB 10.5+
GRANT SUPER ON *.* TO 'romm-user'@'%'; -- older MariaDB, or MySQL
GRANT SUPER ON *.* TO 'romm-user'@'%';
```

Restart RomM once the change is in place. A migration that failed this way is safe to re-run, so it picks up from wherever it stopped and completes.
Expand Down
Loading