cancel
Showing results for 
Search instead for 
Did you mean: 

Executing command php magento indexer:reindex from bin directory of root directory

SOLVED

Executing command php magento indexer:reindex from bin directory of root directory

Hi ,

 

I have installed magento community v2.0.6 on MAMP environment.

 

I am unable to execute the magento reindex command due to the following error. 

 

Zend_Db_Adapter_Exception]                       

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

              

 [PDOException]                                    

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

 

indexer:reindex [index1] ... [indexN]

 

I have extensively tried to fix the above bug on internet  but couldn't figure it out.

 

Could you pls help in resolving this issue. Many thanks in advance.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Executing command php magento indexer:reindex from bin directory of root directory

Hello livastar,

Did you create your custom module with setup Schema?

Please disable that and cheek once.

or try this one http://www.johnshipp.com/php-artisan-migrate-laravel-5-pdoexception-sqlstatehy000-2002-no-such-file-...

Still have problem then try to reinstall magento.

 

Thanks.

View solution in original post

7 REPLIES 7

Re: Executing command php magento indexer:reindex from bin directory of root directory

Hello Livastar,

 

Goto the Magento Installed root directory. Provide the appropriate permission to the bin/magento file,

then execute following command from root directory:

1. php bin/magento indexer:reindex

or 

 go inside the bin directory

cd bin

2. for indexer use the following command

php magento indexer:reindex

 

for cleaning cache:

php magento cache:clean 

 

for compile:

php magento setup:di:compile

 

for setup upgrade:

php magento setup:upgrade

 

Re: Executing command php magento indexer:reindex from bin directory of root directory

Hi,

 

Thanks for your reply. However after execution permission were given experiencing the same issue. I am not sure whether it is about permissions settings ?

 

Thanks in advance

Re: Executing command php magento indexer:reindex from bin directory of root directory

Hello livastar,

Did you create your custom module with setup Schema?

Please disable that and cheek once.

or try this one http://www.johnshipp.com/php-artisan-migrate-laravel-5-pdoexception-sqlstatehy000-2002-no-such-file-...

Still have problem then try to reinstall magento.

 

Thanks.

Re: Executing command php magento indexer:reindex from bin directory of root directory

Thanks for your response.

 

http://www.johnshipp.com/php-artisan-migrate-laravel-5-pdoexception-sqlstatehy000-2002-no-such-file-...

 

Followed the shared link and the commands are executing fine.

 

Thanks.

Re: Executing command php magento indexer:reindex from bin directory of root directory

Hello

I checked the provided link/solution. But, where in the Magento installation did you made this change? Or is it a setting in MAMP?

 

Best,

Magnus

Re: Executing command php magento indexer:reindex from bin directory of root directory

Have you found a solution? I can't find the file neither.

best regards David 

Here is a workaround.

Change from DB_HOST = localhost to DB_HOST = 127.0.0.1 in app/etc/.env and try by clearing the cache.

I have solved the problem this way. Thanks!