Jump to the navigation menu

Setting max_allowed_packet in MariaDB

If you need to set max_allowed_packet for MariaDB, you can specify it in Docker Compose as a command.

For example:

services:
  mariadb:
    image: mariadb:10.9.3
    command: --max_allowed_packet=5GB
    volumes:
      - "./backend_db/mariadb.storage:/var/lib/mysql"
    ports:
      - "3306:3306"
    env_file: ./backend_db/mariadb.env

No Dockerfiles or configuration files needed.

About me

Picture of Oliver

I'm an certified Drupal Triple Expert with 18 years of experience, a Drupal core contributor, public speaker, live streamer, and host of the Beyond Blocks podcast.