Skip to content

Commit 362be2d

Browse files
gantoineclaude
andcommitted
fix: name SUPER as the only grant that lifts the trigger denial
BINLOG ADMIN does not lift error 1419 on any MariaDB version, so the grant this page recommended first leaves the reader exactly where they started. Verified on 10.11.19, 11.3.2 and 11.8.9: only SUPER or the global flag works. MySQL stopped requiring SUPER for trigger DDL in 8.0.22, so scope the section to MariaDB rather than sending MySQL 8 readers after a privilege they hold no need for. Verified on 8.0.46 and 8.4.11 with binary logging on. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 55e70d9 commit 362be2d

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎docs/install/databases.md‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ services:
6868
6969
## Binary logging and trigger privileges
7070
71-
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:
71+
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:
7272

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

80-
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.
80+
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.
8181

8282
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:
8383

@@ -92,13 +92,14 @@ To make it survive a restart, add it under `[mysqld]` in the server's option fil
9292
log_bin_trust_function_creators = 1
9393
```
9494

95-
Alternatively, grant the privilege to the RomM user itself:
95+
Alternatively, grant `SUPER` to the RomM user itself:
9696

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

101+
`SUPER` is the only grant that lifts this check. The finer-grained privileges MariaDB split out of it in 10.5, `BINLOG ADMIN` included, leave the denial in place.
102+
102103
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.
103104

104105
## PostgreSQL

0 commit comments

Comments
 (0)