为什么我可以访问phpmyadmin?

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

请原谅我的英语。我在wsl 2中使用docker,我有一个docker应用程序,有三个图像:phpmyadmin和mysql的配置文件
我的问题是什么,我不能访问phpmyadmin。我可以帮助我吗?附加图像的Docker应用程序运行。

当我试图访问phpmyadmin时,出现了未找到页面。

停靠-撰写.yml

version: '3.8'
services:
    laravel.test:
        build:
            context: ./vendor/laravel/sail/runtimes/8.0
            dockerfile: Dockerfile
            args:
                WWWGROUP: '${WWWGROUP}'
        image: sail-8.0/app
        ports:
            - '${APP_PORT:-80}:80'
        environment:
            WWWUSER: '${WWWUSER}'
            LARAVEL_SAIL: 1
        volumes:
            - '.:/var/www/html'
        networks:
            - sail
        depends_on:
            - mysql
    mysql:
        image: 'mysql:8.0'
        ports:
            - '${FORWARD_DB_PORT:-3306}:3306'
        environment:
            MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}' #empty(niether)
            MYSQL_DATABASE: '${DB_DATABASE}'  #fastfood
            # MYSQL_USER: '${DB_USERNAME}' #root
            MYSQL_PASSWORD: '${DB_PASSWORD}' #empty
            MYSQL_HOST: '${DB_HOST}' #localhost
            MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
        volumes:
            - 'sailmysql:/var/lib/mysql'
        networks:
            - sail
    phpmyadmin:
        image: 'phpmyadmin'
        container_name: pma
        environment:
            PMA_HOST: '${DB_HOST}' #localhost
            PMA_PASSWORD: '${DB_PASSWORD}' #empty(niether)
            PMA_ARBITRARY: 1
        restart: always
        ports:
            - 8081:80
        depends_on:
            - mysql
        networks:
            - sail
networks:
    sail:
        driver: bridge
volumes:
    sailmysql:
        driver: local

信息

视窗10 19052.1052扩充程式3.5.1

9vw9lbht

9vw9lbht1#

请改用http://localhost:8081/
/phpmyadmin只是为wamp这样的服务器软件设置的一条路径,方便您访问phpmyadmin。
由于您已经在docker-compose.yml中定义了

phpmyadmin:
    image: 'phpmyadmin'
    ...
    ports:
        - 8081:80
    ...

即端口8081

相关问题