A
A
alexanderqwert2018-02-18 12:22:22
MySQL
alexanderqwert, 2018-02-18 12:22:22

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 ......"

all required libraries are installed
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

connection to the database through the clients is fine, the application performs migrations successfully, but the requests do not go through! what is the reason?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
ivankomolin, 2018-03-01
@ivankomolin

First of all, in this situation, you need to look at the mysql log

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question