Setting max_allowed_packet in MariaDB

This commit is contained in:
Oliver Davies 2024-09-10 08:00:00 +01:00
parent 1bb48e633e
commit c4af8a7475

27
source/_notes/22.md Normal file
View file

@ -0,0 +1,27 @@
---
title: Setting max_allowed_packet in MariaDB
date: 2024-09-10 08:51:49
tags: [MariaDB, MySQL, Databases]
links:
- https://github.com/MariaDB/mariadb-docker/issues/467
---
If you need to set `max_allowed_packet` for MariaDB, you can specify it in Docker Compose as a `command`.
For example:
```yaml
services:
mariadb:
image: mariadb:10.9.3
command: --max_allowed_packet=1GB
volumes:
- "./backend_db/mariadb.storage:/var/lib/mysql"
ports:
- "3306:3306"
env_file: ./backend_db/mariadb.env
```
No Dockerfiles or configuration files needed.
It can't be more than 1GB, though.