When I run static content deploy on my local Magento2 instance I get this error message:

  SQLSTATE[HY000] [2002] No such file or directory

Is this a etc/hosts and/or virtual hosts issue?

| improve this question | | | | |

This is a combination of issues. This article outlines the problem you are having:


And this goes over how to fix it:


While there are a few different ways to fix this, i have linked to the one solution that i have used.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.