Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Struggling to get phpmyadmin working #426

Open
EBS-DarkD opened this issue Aug 31, 2023 · 1 comment
Open

Struggling to get phpmyadmin working #426

EBS-DarkD opened this issue Aug 31, 2023 · 1 comment
Assignees
Labels

Comments

@EBS-DarkD
Copy link

EBS-DarkD commented Aug 31, 2023

I'm running portainer 2.19.0 and trying to get mariadb and phpmyadmin working together
I'v got a stack setup with the following

db1:
    container_name: mariadb
    image: lscr.io/linuxserver/mariadb
    networks:
      t2_proxy:
        ipv4_address: 192.168.92.***
    ports:
      - "3306:3306"
    volumes:
      - /opt/docker/appdata/mariadb/data:/config
    environment:
      TZ: ***
      PUID: 1000
      PGID: 998
      FILE__MYSQL_ROOT_PASSWORD: /run/secrets/mysql_root_password # Note FILE__ (double underscore) - Issue #127
    secrets:
      - mysql_root_password

I can access this via the portainer console and have logged into the mariadb, created some accounts and a database

For the phpmyadmin, i've got the following

  phpmyadmin:
    image: phpmyadmin:latest
    container_name: phpmyadmin
    networks:
      t2_proxy:
        ipv4_address: 192.168.92.***
    ports:
      - "7005:80"
#    links:
#      - db1:db
    environment:
#      - PMA_HOST=192.168.92.***
#      - PMA_PORT=3306
      - PMA_ARBITRARY=1
#      - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/mysql_root_password
    secrets:
      - mysql_root_password
#    volumes:
#      - /opt/docker/appdata/phpmyad:/etc/phpmyadmin

With the config above, when I try access the web interface, I get the error

Warning: require(/etc/phpmyadmin/config.secret.inc.php): Failed to open stream: Permission denied in /etc/phpmyadmin/config.inc.php on line 3

Fatal error: Uncaught Error: Failed opening required '/etc/phpmyadmin/config.secret.inc.php' (include_path='.:/usr/local/lib/php') in /etc/phpmyadmin/config.inc.php:3 Stack trace: #0 /var/www/html/show_config_errors.php(43): include() #1 {main} thrown in /etc/phpmyadmin/config.inc.php on line 3

If I uncomment the volumes portion, the above error goes but then when I try login, I get the following

mysqli::real_connect(): (HY000/2002): No such file or directory

With the pma_arbitary set to '1', I'm expecting it to ask me for a server, but it doesn't get that far, I just get the username and password box
If I set either the link or the PMA_HOST, I also get the real_connect error.

I've deleted all the config files, containers and images but I still can't get it to work.
Anyone tell me what I've missed here?

@williamdes williamdes self-assigned this Sep 21, 2023
@williamdes
Copy link
Member

williamdes commented Sep 21, 2023

Hi

First you can remove MYSQL_ROOT_PASSWORD_FILE and it's secret config, we do not have any.
The volume is not needed.

One simple example is

You can use an arbitrary server config like this example: https://github.com/phpmyadmin/docker#usage-with-docker-compose-and-arbitrary-server

Or use PMA_HOST or PMA_HOSTS like in my first example

Where is your database server located?
Edit: it's on another docker network
So use the container name in PMA_HOST

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants