I have a docker compose file which is basically trying to build a WAMP/LAMP style environment.
Basically, PHPMyAdmin can't seem to connect to MySQL. Looking through answers here, it appeared that it was an issue with legacy auth using MySQL Image 8 so I added:
command: --default-authentication-plugin=mysql_native_password but that didn't work, so I dropped down to mysql image5.7 and the issue is still present. For some reason, I can't connect to MySQL and I get the error:
mysqli_real_connect(): php_network_getaddresses: getaddrinfo failed: Try again and
mysqli_real_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Try again Here is a copy of my Docker Compose which I don't think is doing anything weird.
Hoping someone can clarify that for me.
version: "3.1" services: site: build: . ports : - "80:80" volumes: - ./www:/var/www/html/ links: - database networks: - php-network ####################################### # PHP MY ADMIN ####################################### phpmyadmin: build: context: . dockerfile: PHPMYADMIN.Dockerfile restart: always links: - database:mysql environment: PMA_HOST: mysql PMA_PORT: 3306 ports: - "8080:80" environment: - MYSQL_USERNAME=admin - MYSQL_PASSWORD=root networks: - php-network ####################################### # MySQL server ####################################### database: image: mysql:5.7.25 ports: - "3306:3306" container_name: db-mysql restart: always environment: - MYSQL_ROOT_PASSWORD=root - MYSQL_DATABASE=test_db - MYSQL_USER=admin - MYSQL_PASSWORD=root networks: - php-network networks: php-network: driver: bridge I also saw mention of a "depends on" flag which I tried too but that also failed to allow me to connect. I have had the same error throughout.
PHPMYADMIN.Dockerfileto the question?