docker
docker copied to clipboard
User not created in phpmyadmin when using docker-compose
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
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
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?
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?
You may intend for those variables to be part of your MariaDB container instead.
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.
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