I'm trying to create a module on a local installation of Magento 2.1.4.
i'm getting this error when running bin/magento setup:upgrade:
[Zend_Db_Adapter_Exception]
SQLSTATE[HY000] [2002] No such file or directory
[PDOException]
SQLSTATE[HY000] [2002] No such file or directory
setup:upgrade [--keep-generated] [--magento-init-params="..."]
After this i tried this solution: Cannot create new module in magento2 – php bin/magento setup:upgrade
The outcome was the same and there is not much explanation on what this did to solve the problem.
I also read solutions from almost a year ago when apparently this was a common issue deleting var/cache, var/generation and var/di but that didn't worked either.
Best Answer
Simple, try the following commands. I have encountered this error, and I have overcome.
In magento 2
I switched to Developer Mode, and deleted the below files.
never delete
pub/static/.htaccess
. putting star*
at the end does not delete.htaccess
file in the folder.you may also need to run setup di compile to optimize and regenerate magento2 file system.