phpmyadmin 连接重置 - docker-compose

phpmyadmin connection reset - docker-compose

我有一个(巨大的)遗留 php5.3 应用程序需要维护。

我正在使用 this docker image 来处理我最近收到的一个旧的(巨大的)代码库。我想添加 phpMyAdmin 以便能够随时调整数据库结构。我将它添加到 docker-compose.yml 文件中,如下所示:

version: '2'
services:
  app:
    image: banesto/docker-php5.3-dev
    container_name: web
    volumes:
      - ./php5-public:/var/www/html
      - ./.database:/var/lib/mysql
      - ./sql:/sql
      - ./logs:/etc/httpd/logs
    ports:
      - "1973:80"
      - "33066:3306"
    stdin_open: true
    environment:
      DB_NAME: dbname
      DB_USER: test
      DB_PASS: test
      MYSQL_ROOT_PASSWORD: my_secret_password
      MYSQL_DATABASE: dbname
      MYSQL_USER: test
      MYSQL_PASSWORD: test

  phpmyadmin:
    image: phpmyadmin/phpmyadmin:4
    container_name: pma
    links:
      - app
    depends_on:
      - app
    environment:
      PMA_HOST: web
      PMA_PORT: 3306
      PMA_ARBITRARY: 0
    restart: always
    ports:
      - 1974:80

当我访问 localhost:1974 时,我看到了 phpmyadmin 登录屏幕。然后我成功登录,但是一旦我登陆 PMA 仪表板,我就会收到此错误消息:

Error in processing request Error code: 200 Error text: OK (rejected) It seems that the connection to server has been lost. Please check your network connectivity and server status.

我回到了登录屏幕。 我也尝试使用最新的 phpmyadmin,同样的错误和行为。 您对如何让它发挥作用有什么想法吗?

原来是phpmyadmin最新的4版本和mysql5.1版本不兼容的问题。 这是工作 docker-compose:

version: '2.1'
services:
  app:
    image: banesto/docker-php5.3-dev
    container_name: web
    volumes:
      - ./php5-public:/var/www/html
      - ./.database:/var/lib/mysql
      - ./sql:/sql
      - ./logs:/etc/httpd/logs
    ports:
      - "1973:80"
      - "33066:3306"
    stdin_open: true
    restart: always
    environment:
      DB_NAME: test
      DB_USER: test
      DB_PASS: test
      MYSQL_ROOT_PASSWORD: my_secret_password
      MYSQL_DATABASE: test
      MYSQL_USER: test
      MYSQL_PASSWORD: test

  pma:
    image: dnhsoft/phpmyadmin:4.0.0
    links:
      - app
    ports:
      - "1974:80"
    environment:
      DBHOST: web
      DBUSER: test
      DBPASS: test