Answer the question
In order to leave comments, you need to log in
mysql connection error problem in docker?
I transferred the project to docker, everything turned out fine, only when requesting the mysql application it gives an error:
"SQLSTATE[HY000] [2002] No such file or directory (SQL: select count(*) as ......"
php:
build:
context: ./docker/php
volumes:
- ./server:/var/www/fileshare
- ./docker/php/php.ini:/usr/local/etc/php/php.ini
links:
- mysql
mysql:
image: mysql:5.7
ports:
- '3306:3306'
volumes:
- ./docker/mysql:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_DATABASE=fileshare
Answer the question
In order to leave comments, you need to log in
First of all, in this situation, you need to look at the mysql log
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question