nezhar / wordpress-docker-compose

Easy Wordpress development with Docker and Docker Compose
MIT License
1.84k stars 1.31k forks source link

Export.sh cant connect to local MySQL #14

Closed jjburr closed 5 years ago

jjburr commented 5 years ago

When executing export.sh it cannot connect to MySQL error 2002

image

nezhar commented 5 years ago

This looks like the database container is not running. Does this also happen when you run docker-compose up?

sophiekovalevsky commented 5 years ago

@nezhar the same is happen to me. I verified that the db container is running. However, when I execute the export script, it creates the file, but appear the same message within the file. Then, instead of dupming the db, it shows the message. Any idea of why this is happening? Thanks in advance,

alabius commented 5 years ago

@nezhar I have same issue with mine too and also, how can I login into the mysql container

nezhar commented 5 years ago

@jjburr @sophiekovalevsky @alabius I was able to reproduce this locally. It looks likedocker-compose run is not setting the defined environment variables. Switching this back to docker-compose exec did the trick. Make sure to have the database container running, as exec requires a running container.

The fix is already available in master.

cmmartin commented 5 years ago

Confirmed it's working now