Closed maitre-hibou closed 3 years ago
@maitre-hibou Did you look at the Troubleshooting section of the README https://github.com/PrestaShop/docker#troubleshooting ? Your issue might be one of the issues mentioned (and solved)
@matks Yeah I've seen this section and already tried to add --protocol=tcp
to the mysql connection line (the only potential fix that correspond to my setup), but I still have the issue.
I forgot to specify that I run this stack on Windows WSL 2 using Docker for Windows.
The problem maybe comes from Docker for Windows. Be sure when you started your MySQL container that everything is ok. Try to connect into this one and test if you can perform SQL queries.
@PierreRambaud I did and everything is OK. I can perform MySQL queries directly into the container without problem.
@maitre-hibou You're doing it inside the container or outside? It's weird that it's not working for you :sweat:
@PierreRambaud When both container are started, in MySQL (database
) container logs, I see the error message Access denied ...
But at the same time I can run the following command with success and perform queries :
docker-compose exec database mysql -uxpressive -p5ecr3t prestashop
I just can't login to MySQL on database
container from my shop
container.
I forgot to mention that this issue happens only when I try to auto install shop. When I perform a manual installation and when I'm asked to provide database credentials and test connection, it works perfectly.
Be sure you're using the container name during the installation: https://github.com/PrestaShop/PrestaShop/blob/develop/docker-compose.yml#L26
I checked and I'm using the correct name (I tried both the name of the service - database
- and the container name generated by docker compose - prestashop_dev_database_1
)
I didn't manage to reproduce the issue :(
@PierreRambaud Did you run it on Docker WSL or on Docker on Linux ? Just to know where to search more infos
I'm running it on Linux ^^
Ok I set up a fresh dual boot Linux Mint install, performed Docker installation by following docs, and tried to make my docker-compose.yml
file simpler :
version: "3"
services:
shop:
image: prestashop/prestashop:1.7
depends_on:
- database
environment:
- ADMIN_MAIL=contact@xpressive.io
- ADMIN_PASSWORD=5ecr3t
- DB_SERVER=database
- DB_DATABASE=prestashop
- DB_USER=prestashop
- DB_PASSWORD=5ecr3t
- PS_COUNTRY=FR
- PS_DEMO_MODE=1
- PS_DEV_MODE=1
- PS_DOMAIN=prestashop.xpressive.local
- PS_INSTALL_AUTO=1
- PS_LANGUAGE=fr
database:
image: mysql:5.7
environment:
- MYSQL_ROOT_PASSWORD=5ecr3t
- MYSQL_DATABASE=prestashop
- MYSQL_USER=prestashop
- MYSQL_PASSWORD=5ecr3t
But the problem is still the same ...
Because you're using the wrong environement variable
version: "3"
services:
shop:
image: prestashop/prestashop:1.7
depends_on:
- database
environment:
- ADMIN_MAIL=contact@xpressive.io
- ADMIN_PASSWORD=5ecr3t
- DB_SERVER=database
- DB_DATABASE=prestashop
- DB_USER=prestashop
- DB_PASSWD=5ecr3t
- PS_COUNTRY=FR
- PS_DEMO_MODE=1
- PS_DEV_MODE=1
- PS_DOMAIN=prestashop.xpressive.local
- PS_INSTALL_AUTO=1
- PS_LANGUAGE=fr
database:
image: mysql:5.7
environment:
- MYSQL_ROOT_PASSWORD=5ecr3t
- MYSQL_DATABASE=prestashop
- MYSQL_USER=prestashop
- MYSQL_PASSWORD=5ecr3t
Don't ask me why they choose PASSWD instead of PASSWORD :sweat:
Oh my 😅.... Thank you it works now ! Yeah that choice is very misleading, especially as it is spelled correctly on ADMIN_PASSWORD
Hello there,
I'm trying to setup a local dev environment for Prestashop on a Docker Compose stack. (edit : I setup this stack on a Windows WSL2 installation using Docker for Windows) When running my stack, auto install fails because Prestashop container is unable to connect to MySQL container using provided credentials.
Here is my
docker-compose.yml
config :And here is the error shown in MySQL container logs :
However, when I run the following command, I'm able to connect to MySQL container :
I've tried to override the docker_run.sh script to display the value of environment variable with the following :
I'm guessing that error is due to the fact that IP address is used instead of FQDN, but I don't know why...
Anyone has a clue on this ?
Thanks in advance !