I am a totally beginner at Shopware and I want to use PhpMyAdmin for my local Shopware 6 setup.
For the download I used the official Shopware 6 Development repository https://github.com/shopware/development
I’ve already seen that the docker-compose.yml has implemented the following:
app_mysql:
build: dev-ops/docker/containers/mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: app
MYSQL_PASSWORD: app
networks:
shopware:
aliases:
- mysql
and now I want to implement phpmyadmin. I tried the following:
phpmyadmin:
image: phpmyadmin/phpmyadmin
links:
- app_mysql:mysql
depends_on:
- app_mysql
ports:
- 8181:80
environment:
PMA_HOST: app_mysql
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: app
MYSQL_PASSWORD: app
phpmyadmin is visible on localhost:8181 but when I try to login I get the following errors:
mysqli::real_connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known
mysqli::real_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known
How can I solve it?
4
Answers
You must use as host mysql or app_mysql
It is not an answer, but try
http://localhost:8001/
it is not phpMyAdmin but it is another tool
Adminer
🙂You should link phpmyadmin and mysql using
use it as :
Add environment:
Usually
phpmyadmin
should be in the same network as the database.Service names are resolved to the IP addresses of the containers, therefore it’s recommended to use names allowed by RFC1035 to avoid additional problems.
I removed
links:
,aliases
,depends_on
that are deprecated/not required and ended up with thisdocker-compose.yml
.Run the containers:
Open
http://localhost:8181/index.php
in a browser.Use
Enjoy: