I'm trying reindex latest Magento 2 using OSX 10.11 terminal with php bin/magento indexer:reindex command without success. Terminal returns same error on two red blocks.

enter image description here

– Maybe MYSQL socket problem?

ps. Magento2 is setup on MAMP PRO 3.


this is the same problem that is happening here:

MAMP Errors for Magento Command Line

With the solution being found here:


I just had to put this line in my .bash_profile. If you don't have one, just make one under your user.

vi ~/.bash_profile

And then add in this line, paying attention to the version of php that you are running.

export MAMP_PHP=/Applications/MAMP/bin/php/php7.0.22/bin
|improve this answer|||||

If you are using mamp go to the root directory where Magento is installed and type php in front of the command.

php bin/magento cache:clean
|improve this answer|||||

first command: php bin/magento cache:flush

second command: php bin/magento indexer:reindex

working 100%

|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.