As a magento newby I have installed magento 2.1.8. After the install I get an error in the admin saying that one or more indexers are invalid, so I have found some help online showing how to reindex, but when I use these commandlines I get errors back saying…
php bin/magento index:reindex
[Zend_Db_Adapter_Exception]
SQLSTATE[HY000] [2002] No such file or directory
[PDOException]
SQLSTATE[HY000] [2002] No such file or directory
Install is on localhost -> MAMP.
2
Answers
This error occur when you remove store or website not properly. Check the store_group and store_website table and compare the entry with Content -> Configurations in Magento admin. Remove additional entry from database. I had personally used it and its work fine.
The “SQLSTATE[HY000] [2002]” error is usually related to the MySQL DB being down and/or Magento being unable to connect to it.
Before
After
Please check if:
(a) Your MySQL instance is up and running.
(b) The user account, your Magento instance is setup to use, can connect to the MySQL DB and also has sufficient grants/privileges to access the Magento DB tables.
P.S: When you say you’ve installed Magento, I’m assuming you cloned the github repo and ran through the appropriate Magento setup/install steps … Correct?