I have a vagrant box (debian) with a Magento2 installation for development. Everything works nice, but changing css/less is very very slow (because everytime I have to remove pub/frontend and var/view_processing/*), developing a theme is not nice in Magento2... :(

That's why I have installed NPM + Grunt on my local Mac. But when I run grunt exec:theme I always get an error:

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

I understand that my local Grunt cannot connection my database (because I have a vagrant box), but how can I work with Grunt on my LOCAL environment (ex. PHP Storm), without database connection errors?

1 Answer 1


I had the same problem, as far as I found, this happens a because a different php instance is being used in your cli compared to the web server.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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