Create Admin User Error: SQLSTATE[HY000] [1130] Host 'nextcloud.nextcloud_default' is not allowed to connect to this MariaDB server

Hi, so I’m getting this error when trying to create an admin user on MySQL/MariaDB database:
Error while trying to create admin account: An exception occurred in the driver: SQLSTATE[HY000] [1130] Host ‘nextcloud.nextcloud_default’ is not allowed to connect to this MariaDB server

I use for it a raspberry pi 5 and Portainer through https://pi-hosted.com/ as well as using this video for the installation as a tutorial: https://www.youtube.com/watch?v=rnZoTEZ2Z0U

I saw on some forums that unique letters in passwords can lead it to fail so I use only upper case, lower case and numbers for my passwords.

If that would help, here’s my docker compose file:

version: "2"

services:

nextcloud:

image: linuxserver/nextcloud:latest

container_name: nextcloud

environment:

    PUID=${PUID}

    PGID=${PGID}

    TZ=${TZ}

volumes:

    /portainer/Files/AppData/Config/Nextcloud/Config:/config

    /portainer/Files/AppData/Config/Nextcloud/Data:/data

ports:

    ${PORT}:443

restart: unless-stopped

depends_on:

    nextcloud_db

    nextcloud_db:

image: linuxserver/mariadb:latest

container_name: nextcloud_db

environment:

    PUID=${PUID}

    PGID=${PGID}

    MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}

    TZ=${TZ}

    MYSQL_DATABASE=nextcloud_db

    MYSQL_USER=nextcloud

    MYSQL_PASSWORD=${DATABASE_PASSWORD}

volumes:

    /portainer/Files/AppData/Config/Nextcloud/DB:/config

restart: unless-stopped

P.S: I’m very new to docker so I kinda have no idea what I’m doing. Help would be appreciated!

Can you elaborate a bit about what parameters you’re entering on the setup screen since it appears you’re doing a manual setup?

The credentials it is complaining about are your db ones.

P.S. When posting preformatted stuff (e.g. config files) please wrap them as preformatted in the editor. They’re challenging to read otherwise.

Thanks for telling me about preformating. Didn’t know that it can be done manually through the text editor.
In the setup screen I typed on the Database account field: nextcloud
Then in database name I typed: nextcloud_db
And on Database host I wrote: nextcloud_db:3306
Like so: