phpmyadmin连接重置- docker-compose

whlutmcx  于 2022-11-09  发布在  PHP
关注(0)|答案(1)|浏览(246)

我有一个(巨大的)遗留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 Jmeter 板,我就收到了这个错误消息:
处理请求时出错错误代码:200错误文本:确定(拒绝)与服务器的连接似乎已丢失。请检查您的网络连接和服务器状态。
我又回到了登录界面。我也试过用最新的phpmyadmin,同样的错误和行为。你有办法让它工作吗?

mctunoxg

mctunoxg1#

原来这是phpmyadmin的最新4版本和mysql 5.1版本之间的不兼容问题。

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

相关问题