MariaDB / mariadb-docker

Docker Official Image packaging for MariaDB
https://mariadb.org
GNU General Public License v2.0
767 stars 438 forks source link

Issue with mounting a volume with `/*!999999\- enable the sandbox mode */ ` #584

Closed earthiverse closed 4 months ago

earthiverse commented 4 months ago

I have mariadb as a service in my docker-compose.yml.

services:
  mariadb:
    image: mariadb:latest
    environment:
      # ...
    networks:
      # ...
    volumes:
      - ./schema/hospitality.sql:/docker-entrypoint-initdb.d/000-hospitality.sql

The SQL file in the volumes has /*!999999\- enable the sandbox mode */ as the first line of the dump.

When I run docker compose to start my container, I get

mariadb-1     | 2024-05-28 09:06:41+09:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/000-hospitality.sql
mariadb-1     | ERROR at line 1: Unknown command '\-'.
mariadb-1 exited with code 1

If I remove the sandbox comment, it works fine.

mariadb-1     | 2024-05-28 09:07:48+09:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/000-hospitality.sql
mariadb-1     | 
mariadb-1     | 
mariadb-1     | 2024-05-28 09:07:48+09:00 [Note] [Entrypoint]: Stopping temporary server
...
grooverdan commented 4 months ago

What version was the dump from?

Because MariaDB-11.4 is late in being released (few bugs being fixed up), the < 11.4 releases include the sandbox mode, while the mariadb:latest is still 11.3, not supporting this mode.

I don't have any suggested solutions beyond what you have done and the suggestions in the blog below.

ref: https://mariadb.org/mariadb-dump-file-compatibility-change/

Within a few days hopefully 11.4 will be released, become mariadb:latest and compatibility will be regained.

earthiverse commented 4 months ago

What version was the dump from?

-- MariaDB dump 10.19 Distrib 10.11.8-MariaDB, for Linux (x86_64)

So, it will fix itself in a week or two, thanks! I'll use an earlier version for now :)

grooverdan commented 4 months ago

released now. Note mariadb:lts and mariadb:latest is now 11.4. Let me know if you still have problem.s