• dscottboggs

    (@dscottboggs)


    I have a straightforward docker-compose configuration for prototyping a new site:

    
    version: "3.8"
    
    services:
      database:
        image: mariadb:10
        restart: always
        environment:
          MYSQL_RANDOM_ROOT_PASSWORD: 'true'
          MYSQL_DATABASE: ${MYSQL_DATABASE}
          MYSQL_USER: ${MYSQL_USER}
          MYSQL_PASSWORD: ${MYSQL_PASSWORD}
        volumes:
          - ./mounts/database:/var/lib/mysql
        networks: [internal]
      site:
        image: wordpress
        expose: [8080]
        environment:
          WORDPRESS_DB_HOST: database
          WORDPRESS_DB_USER: ${MYSQL_USER}
          WORDPRESS_DB_NAME: ${MYSQL_DATABASE}
          WORDPRESS_DB_PASSWORD: ${MYSQL_PASSWORD}
          WORDPRESS_DEBUG: 'true'
        depends_on: [database]
        volumes:
          - ./mounts/wordpress:/var/www/html
        networks:
          - web
          - internal
        labels:
          traefik.docker.network: web
          traefik.enable: "true"
          traefik.frontend.rule: Host:test-wp-podcast.tams.tech
          tech.tams.dns_hosts: test-wp-podcast.tams.tech
    
    networks:
      web:
        external: true
      internal:
        internal: true
    

    This looks like it should work, but when I open the page, I receive:

    Warning: mysqli_real_connect(): (HY000/1045): Access denied for user 'wordpress'@'172.22.0.16' (using password: YES) in /var/www/html/wp-includes/wp-db.php on line 1653

    Access denied for user 'wordpress'@'172.22.0.16' (using password: YES)

    If I simply SSH into the server and run

    mysql -h 172.28.0.2 -u wordpress -p

    …and paste the password which is the same as what is listed in env on the wordpress container, and it works, it logs in.

The topic ‘Access denied using password on initial setup’ is closed to new replies.