Host '172.18.0.2' is not allowed to connect to this MariaDB server

I installed Passbolt CE using Docker by following the official documentation. I’m experiencing an error when trying to create my first user.

Caused by: [PDOException] SQLSTATE[HY000] [1130] Host ‘172.18.0.2’ is not allowed to connect to this MariaDB server in /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Database/Driver.php on line 132
2024-08-05 08:30:46 error: Could not connect to Database.

Here are the contents of my docker-compose-ce.yaml file:

version: "3.9"
services:
  db:
    image: mariadb:10.11
    restart: unless-stopped
    environment:
      MYSQL_RANDOM_ROOT_PASSWORD: "true"
      MYSQL_DATABASE: "passbolt"
      MYSQL_USER: "passbolt"
      MYSQL_PASSWORD: "P4ssb0lt"
    volumes:
      - database_volume:/var/lib/mysql

  passbolt:
    image: passbolt/passbolt:latest-ce
    #Alternatively you can use rootless:
    #image: passbolt/passbolt:latest-ce-non-root
    restart: unless-stopped
    depends_on:
      - db
    environment:
      APP_FULL_BASE_URL: https://localhost:443
      DATASOURCES_DEFAULT_HOST: "db"
      DATASOURCES_DEFAULT_USERNAME: "passbolt"
      DATASOURCES_DEFAULT_PASSWORD: "P4ssb0lt"
      DATASOURCES_DEFAULT_DATABASE: "passbolt"
    volumes:
      - gpg_volume:/etc/passbolt/gpg
      - jwt_volume:/etc/passbolt/jwt
    command:
      [
        "/usr/bin/wait-for.sh",
        "-t",
        "0",
        "db:3306",
        "--",
        "/docker-entrypoint.sh",
      ]
    ports:
      - 80:80
      - 443:443
    #Alternatively for non-root images:
    # - 80:8080
    # - 443:4433

volumes:
  database_volume:
  gpg_volume:
  jwt_volume:

I changed APP_FULL_BASE_URL from passbolt.local to https://localhost:443 and this is when the error started to show.

This is a MySQL setup issue, you need to allow connections from other hosts. See Allow all remote connections, MySQL - Stack Overflow

The issue is resolved. Thanks for your response.

May i ask how you resolved it, i face the same problem.

Well i resolved it myself

#image: mariadb:10.11
image: mariadb:lts

did the trick, maybe the image was bad.