nanoninja / docker-nginx-php-mysql

Docker running Nginx, PHP-FPM, MySQL & PHPMyAdmin
1.76k stars 867 forks source link

phpMyAdmin -- Login Screen #25

Closed zanematthew closed 6 years ago

zanematthew commented 6 years ago

On the phpMyAdmin login screen how is the "Server:" setting derived? Currently I can connect to the DB via PDO, but I cannot login via the pma screen.

I've recently adjusted the NGINX_HOST, and configured the phpMyAdmin and MySQL containers as follows;

myadmin:
  image: phpmyadmin/phpmyadmin
  container_name: ${APP_NAME}_phpmyadmin
  ports:
    - "8080:80"
  environment:
    - PMA_ARBITRARY=1
    - PMA_HOST=${APP_NAME}_${MYSQL_HOST}
  restart: always
  depends_on:
    - mysqldb
mysqldb:
  image: mysql
  container_name: ${APP_NAME}_${MYSQL_HOST}
  restart: always
  env_file:
    - ".env"
  environment:
    - MYSQL_DATABASE=${MYSQL_DATABASE}
    - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
    - MYSQL_USER=${MYSQL_USER}
    - MYSQL_PASSWORD=${MYSQL_PASSWORD}
  ports:
    - "8989:3306"
  volumes:
    - "./database/data/db/mysql:/var/lib/mysql"
  networks:
    - esnet_new

I'm presuming my issue is something with the container_name I've set.

screen shot 2018-04-04 at 8 59 58 am
zanematthew commented 6 years ago

There's alot of "gotcha's" in realizing in Docker. My issue was that I had configured a docker network and placed phpMyAdmin on a network, once I updated the docker-compose section of pma to be on the same network, all was well with the universe again.

FWIW, "Server:" is left blank.