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

User not created in phpmyadmin when using docker-compose #392

Open
sandwichdreams opened this issue Dec 19, 2022 · 6 comments
Open

User not created in phpmyadmin when using docker-compose #392

sandwichdreams opened this issue Dec 19, 2022 · 6 comments

Comments

@sandwichdreams
Copy link

sandwichdreams commented Dec 19, 2022

When I run docker-compose up the container starts and I can log in with root, but no user named phpmyadmin is created. Is there something missing in the yml file?

version: "3.0"

networks:
    dev:

services:
  mariadb:
    image: mariadb:latest
    restart: always
    ports:
      - 3306:3306
    environment:
      - MYSQL_ROOT_PASSWORD=root
      - MYSQL_DATABASE=example
      - MYSQL_USER=mariadb
      - MYSQL_PASSWORD=mariadb
    volumes:
      - /docker/mariadb:/var/lib/mysql
      - /etc/localtime:/etc/localtime:ro
    networks:
      - dev
 
  phpmyadmin:
    image: phpmyadmin:latest
    depends_on:
      - mariadb
    restart: always
    ports:
      - "8080:80"
    environment:
      - MYSQL_ROOT_PASSWORD=root
      - MYSQL_USER=phpmyadmin
      - MYSQL_PASSWORD=phpmyadmin
      - PMA_HOST=mariadb
    volumes:
      - /etc/localtime:/etc/localtime:ro
    networks:
      - dev
@williamdes
Copy link
Member

Hi
I think youare mistaken, the only user that will be created is by MariaDB container: mariadb

See https://github.com/phpmyadmin/docker/blob/master/testing/docker-compose/docker-compose.testing-one-host.yml as another example

@sandwichdreams
Copy link
Author

sandwichdreams commented Dec 20, 2022

When I read the documentation, I understand it like this:

If I have the MYSQL_ROOT_PASSWORD variable, phpMyAdmin logs in and creates the user that I entered via MYSQL_USER with the password MYSQL_PASSWORD

If this is not correct. Is there any other variable to implement so I automatically create a user in the phpMyAdmin container?

@williamdes
Copy link
Member

If this is not correct. Is there any other variable to implement so I automatically create a user in the phpMyAdmin container?

Actually there is no such feature, I am not sure we should add it. And this variable does not exist, see: https://github.com/phpmyadmin/docker#environment-variables-summary

Where did you see such a configuration?

@ibennetch
Copy link
Member

You may intend for those variables to be part of your MariaDB container instead.

@rk9qn3j
Copy link

rk9qn3j commented Jan 22, 2023

Where did you see such a configuration?

https://github.com/phpmyadmin/docker#credentials

When reading those lines, I get the impression that the phpmyadmin container uses the root credentials to log in and create a new user with a specific username and password.

@williamdes
Copy link
Member

Where did you see such a configuration?

https://github.com/phpmyadmin/docker#credentials

When reading those lines, I get the impression that the phpmyadmin container uses the root credentials to log in and create a new user with a specific username and password.

Okay, maybe we need to clarify that. The two ENVs are not for our container

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

No branches or pull requests

4 participants