Installation is broken (mysql access denied)

To be completed by the original poster:

CMS Version

latest (I don’t know)

Installation Method

Docker

Operating System

Debian

Issue

I’ve just installed it for the first time ever and I get a mysql error
Fatal Error - sorry this shouldn’t happen.
SQLSTATE[HY000] [1045] Access denied for user ‘cms’@‘172.20.0.3’ (using password: NO)

version: "2.1"

services:
    cms-db:
        image: mysql:8.0
        volumes:
            - "/data/sata2/xibo-cms/db:/var/lib/mysql:Z"
        environment:
            - MYSQL_DATABASE=cms
            - MYSQL_USER=cms
            - MYSQL_RANDOM_ROOT_PASSWORD=yes
        mem_limit: 1g
        env_file: config.env
        restart: always
    cms-xmr:
        image: ghcr.io/xibosignage/xibo-xmr:0.11
        ports:
            - "9505:9505"
        restart: always
        mem_limit: 256m
        env_file: config.env
    cms-web:
        image: ghcr.io/xibosignage/xibo-cms:release-4.0.11
        volumes:
            - "/data/sata2/xibo-cms/cms/custom:/var/www/cms/custom:Z"
            - "/data/sata2/xibo-cms/backup:/var/www/backup:Z"
            - "/data/sata2/xibo-cms/cms/web/theme/custom:/var/www/cms/web/theme/custom:Z"
            - "/data/sata2/xibo-cms/cms/library:/var/www/cms/library:Z"
            - "/data/sata2/xibo-cms/cms/web/userscripts:/var/www/cms/web/userscripts:Z"
            - "/data/sata2/xibo-cms/cms/ca-certs:/var/www/cms/ca-certs:Z"
        restart: always
        environment:
            - MYSQL_HOST=cms-db
            - XMR_HOST=cms-xmr
            - CMS_USE_MEMCACHED=true
            - MEMCACHED_HOST=cms-memcached
        env_file: config.env
        ports:
            - "8011:80"
        mem_limit: 1g
    cms-memcached:
        image: memcached:alpine
        command: memcached -m 15
        restart: always
        mem_limit: 100M
    cms-quickchart:
      image: ianw/quickchart
      restart: always

I fixed it by adding a fixed network name to each service in the docker compose file

version: "2.1"

services:
    cms-db:
        image: mysql:8.0
        networks:
            - xibo
        volumes:
            - "/data/sata2/xibo-cms/db:/var/lib/mysql:Z"
        environment:
            - MYSQL_DATABASE=cms
            - MYSQL_USER=cms
            - MYSQL_RANDOM_ROOT_PASSWORD=yes
        mem_limit: 1g
        env_file: config.env
        restart: always
    cms-xmr:
        image: ghcr.io/xibosignage/xibo-xmr:0.11
        networks:
            - xibo
        ports:
            - "9505:9505"
        restart: always
        mem_limit: 256m
        env_file: config.env
    cms-web:
        image: ghcr.io/xibosignage/xibo-cms:release-4.0.11
        networks:
            - xibo
        volumes:
            - "/data/sata2/xibo-cms/cms/custom:/var/www/cms/custom:Z"
            - "/data/sata2/xibo-cms/backup:/var/www/backup:Z"
            - "/data/sata2/xibo-cms/cms/web/theme/custom:/var/www/cms/web/theme/custom:Z"
            - "/data/sata2/xibo-cms/cms/library:/var/www/cms/library:Z"
            - "/data/sata2/xibo-cms/cms/web/userscripts:/var/www/cms/web/userscripts:Z"
            - "/data/sata2/xibo-cms/cms/ca-certs:/var/www/cms/ca-certs:Z"
        restart: always
        environment:
            - MYSQL_HOST=cms-db
            - XMR_HOST=cms-xmr
            - CMS_USE_MEMCACHED=true
            - MEMCACHED_HOST=cms-memcached
        env_file: config.env
        ports:
            - "8011:80"
        mem_limit: 1g
    cms-memcached:
        networks:
            - xibo
        image: memcached:alpine
        command: memcached -m 15
        restart: always
        mem_limit: 100M
    cms-quickchart:
        networks:
            - xibo
        image: ianw/quickchart
        restart: always
networks:
    xibo:

Depends on the Docker/Docker compose version.

By default, docker services use the network specified in the docker compose file.

Maybe try changing the version (first line) to 3.7

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.